title: Why doesn't shared_ptr<A> implicit convert to shared_ptr<A const>?
body: <p>I tried to introduce some <code>const</code> correctness (actually functional paradigms) to some new code and found that I cannot pass an <code>std::shared_ptr&lt;A&gt;</code> to a function that expects an <code>std::shared_ptr&lt;A const&gt;</code>. Note that I don't want to cast <em>away</em> constness but introduce it, which is legal with raw pointers.</p>
  
  <p>Is there some way to get around this? I didn't find a member-function to do this.</p>
  
  <hr>
  
  <p>The precise error uttered by g++ 4.6.1 is:</p>
  
  <pre><code>error: no matching function for call to ‘foo(std::shared_ptr&lt;A&gt;)’
  note: candidate is:
  note: template&lt;class T&gt; std::shared_ptr&lt;_Tp&gt; foo(std::shared_ptr&lt;const _Tp&gt;)
  </code></pre>