
----- Original Message ----- From: <strasser@uni-bremen.de> To: <boost@lists.boost.org> Sent: Sunday, February 14, 2010 6:35 PM Subject: Re: [boost] Downcast taking account of virtual inheritance
Zitat von "vicente.botet" <vicente.botet@wanadoo.fr>:
B* ptr; ptr= new D(); D* dPtr = downcast<D*>(ptr); // uses static_cast as is_virtual_base_of<B,D>::type is false
ptr= new DV(); DV* dPtr = downcast<DV*>(ptr); // uses dynamic_cast as is_virtual_base_of<B,DV>::type is true
What would be a good name for this downcast function?
http://www.boost.org/doc/libs/1_42_0/libs/serialization/doc/smart_cast.html
Thanks, I'll take a look on this. BTW, it would be a good idead to add a link from the conversion library page to this page. Is there any issue to do that? Vicente