title: Boost shared_ptr passing a derived class
body: <p>So I have something like so</p>
  
  <pre><code>class baseclass {
  ....
  }
  
  class derived : public baseclass {
  ...
  }
  
  void func(boost::shared_ptr&lt;baseclass&gt;&amp; a){
  //stuff
  }
  
  boost::shared_ptr&lt;derived&gt; foo;
  
  func(foo);
  </code></pre>
  
  <p>Will this work? I assume not because its not the same type, however I do not posses the ability to cast it to the right type, so is there any work around that you can think of that will make this work?</p>
  
  <p>Edit: the reason I can't do the cast to my knowledge is because I'm doing a sort on a vector of type <code>boost::shared_ptr&lt;derived&gt;</code>so I only call sort with vec.begin() and vec.end()</p>