title: Passing vectors of derived shared pointers?
body: <p>What is the proper way to allow vectors of shared pointers to a derived class to get passed to a function which is expecting a vector of shared pointers to a base class without performing a copy?</p>
  
  <p>Here is the code:</p>
  
  <pre><code>#include &lt;string&gt;
  #include &lt;vector&gt;
  #include &lt;memory&gt;
  
  class Base {
  public:
      std::string Name;
  };
  using BaseList = std::vector&lt;std::shared_ptr&lt;Base&gt;&gt;;
  
  class Derived : Base {
  };
  using DerivedList = std::vector&lt;std::shared_ptr&lt;Derived&gt;&gt;;
  
  class BaseHandler {
  public:
      void process( BaseList list ) {
      }
  };
  
  int main() {
  
      DerivedList list;
  
      BaseHandler bh;
      bh.process( list );
  
  }
  </code></pre>
  
  <p>Code Link: <a href="http://coliru.stacked-crooked.com/a/5a5b18ba3b2a4f08" rel="nofollow noreferrer">http://coliru.stacked-crooked.com/a/5a5b18ba3b2a4f08</a></p>
  
  <p>EDIT: DOH!!!  I posted the wrong one.   Sorry about that...here is the shared_ptr one.</p>