I propose to implement any_cast<A&>(x) and any_cast<A*>(x) with the
semantics of dynamic_cast. That is, if x has type A, any_cast<A&>(x)
returns a reference to the content of x and any_cast<A*>(x) returns a
pointer to the content of x. Else, any_cast<A&>(x) throws bad_any_cast
and any_cast<A*>(x) returns the NULL pointer.
any_cast<A>(X) will work the semantics of static_cast, that is, returns
a copy of the content of x.
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
- [boost] Proposal for any_cast to references Unai Uribarri
- Re: [boost] Proposal for any_cast to referenc... David Abrahams
- Re: [boost] Proposal for any_cast to refe... Douglas Gregor
- Re: [boost] Proposal for any_cast to ... Peter Dimov
- Re: [boost] Proposal for any_cast... Douglas Gregor
- Re: [boost] Proposal for any... Jason House
- Re: [boost] Proposal for... Douglas Paul Gregor
- [boost] Re: Proposal for any... Unai Uribarri Rodríguez
- Re: [boost] Re: Proposal for any_... Unai Uribarri Rodríguez
- Re: [boost] Re: Proposal for... Douglas Paul Gregor
- [boost] Re: Proposal for... Unai Uribarri Rodríguez
- Re: [boost] Re: Prop... Douglas Paul Gregor
- [boost] Re: Proposal for any_cast to refe... Unai Uribarri Rodríguez
- [boost] Re: Proposal for any_cast to ... David B. Held