Boost logo

Boost :

From: Unai Uribarri Rodríguez (unaiur_at_[hidden])
Date: 2003-01-15 16:17:51


any_cast, as is implemented in boost 1.29, has one weakness; it doesn't
allow to compile this piece of code:

   any x=int(5);
   ++any_cast<int&>(x);

because any_cast tries to instanciate a pointer to int&. The attached
patch solved this problem using boost::remove_reference from
boost/type_traits.hpp.

any_cast<T&>(x) will return a reference to value contained in x if its
type is T, or raise bad_cast otherwise.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk