How can I cast a base smart pointer into the derived one in C++?
<p>Code : </p>

<pre><code>class Base {
    ...
};

class Derived : public Base {
    void OnlyOwnedByDerived{
        ...
    }
};
</code></pre>

<p>The question is :
1. If I used a smart pointer of the Base class to reference the Derived one, the reason why I do so is that I want to get the benefit of dynamic binding which only fits virtual functions. But if I want to to use the function that is <strong>only owned by the derived class</strong>, what should I do ?
<code>static_cast</code> between the smart pointer of different class gives me an error...</p>

<ol start="2">
<li>The most direct way I can come up with is use raw pointer rather than smart one...</li>
</ol>