Subject: Re: [boost] Downcast taking account of virtual inheritance
From: vicente.botet (vicente.botet_at_[hidden])
Date: 2010-02-14 14:03:15


----- Original Message -----
From: <strasser_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Sunday, February 14, 2010 6:35 PM
Subject: Re: [boost] Downcast taking account of virtual inheritance

>
> Zitat von "vicente.botet" <vicente.botet_at_[hidden]>:
>
>> 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