You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
int main(int argc, char** argv)<br />
{<br />
<strong>Poco</strong>::SharedPtr pA;<br />
<strong>Poco</strong>::SharedPtr pB(new B);<br />
pA = pB;<br />
pA = new B;<br />
// okay, pB is a subclass of pA<br />
// pB = pA; // will not compile<br />
pB = pA.cast();<br />
// okay<br />
<strong>Poco</strong>::SharedPtr pC(new C);<br />
pB = pC.cast();<br />
// pB is null<br />
}<br />
return 0;