title: How to pass array of const referenced shared pointer to other function in c++
body: <p>I'd like to pass an array of const referenced shared pointer to another class.</p>
  <p>How to use a function parameter for it?</p>
  <p>Below is example.</p>
  <pre><code>// &lt; BaseClass &gt;
   std::shared_pointer&lt;queue&gt; queue_[3];
  
  // init 0,1,2
   queue[0] = std::make_shared&lt;queue&gt;
  
  // move queue to inner class
  // Is this right usage?
  std::vector&lt;const std::make_shared&lt;queue&gt;&amp;&gt; queue_vector;
  queue_vector.emplace_back(queue[0]);
  queue_vector.emplace_back(queue[1]);
  queue_vector.emplace_back(queue[2]);
  
   InnerClass.init(queue_vector)
  </code></pre>
  <pre><code>&lt;InnberClass&gt;
      // I don't know how to use func param
      // this is normal usage to pass shared pointer
      init(const std::shared_pointer&lt;queue&gt;&amp; queue)
      {
        queue_ = queue;
      }
      // array of share pointer(const ref) to func
      init(const std::vector&lt;const std::make_shared&lt;queue&gt;&amp;&gt;&amp; queue_vector)
      {
          queue_array_[0] = queue_vector.at(0);
          queue_array_[1] = queue_vector.at(1);
          queue_array_[2] = queue_vector.at(2);
      }
  </code></pre>