title: boost::shared_ptr and dynamic cast
body: <p>I have a problem using a <code>shared_ptr</code> of a base class, I can't seem to be able to call the derived class's methods when dereferencing it. I believe code will be more verbose than me:</p>
  
  <pre><code>class Base : public boost::enable_shared_from_this&lt;Base&gt;
  {
    public:
      typedef  boost::shared_ptr&lt;BabelNet&gt; pointer;
  };
  
  class Derived : public Base
  {
    public:
       static pointer  create()
                  {
                          return pointer(new Derived);
                  }
       void             anyMethod()
       {
          Base::pointer foo = Derived::create();
          // I can't call any method of Derived with foo
          // How can I manage to do this ?
          // is dynamic_cast a valid answer ?
          foo-&gt;derivedMethod(); // -&gt; compilation fail
       }
  
  };
  </code></pre>