title: cannot bind non-const lvalue reference of type to an rvalue of type
body: <pre><code>void Create_moneys(shared_ptr&lt;CoinMoney&gt;* &amp;ms){
      int max = getSize(true);
      for(size_t i = 0; i &lt; max; ++i){
          cout &lt;&lt; "ms is : " &lt;&lt;typeid(ms[i]).name() &lt;&lt; endl;
          ms[i] = make_shared&lt;CoinMoney&gt;();
          ms[i]-&gt;c50 = i+1;
          ms[i]-&gt;c100 = i+2;
          ms[i]-&gt;c500 = i+3;
      }
  }
  
  int main(int argc, char* argv[]){
      shared_ptr&lt;CoinMoney&gt; pm1[getSize(true)];
      Create_moneys(pm1); // error
      for(auto p : pm1)
          CoinMoney_Print(*p);
      return 0;
  }
  </code></pre>
  
  <p>I'm getting this error "cannot bind non-const lvalue reference of type ~ to an rvalue of type </p>
  
  <p>How can I fix this?</p>