|
Boost : |
Subject: Re: [boost] Downcast taking account of virtual inheritance
From: strasser_at_[hidden]
Date: 2010-02-14 12:35:48
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
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk