Boost logo

Boost :

Subject: Re: [boost] [any] boost::get style accessors
From: Christoph Heindl (christoph.heindl_at_[hidden])
Date: 2010-04-28 00:25:14


vicente,

> Doesn't any_cast do what you are looking for?
>  template<typename T> T any_cast(any &);
>  template<typename T> T any_cast(const any &);
>  template<typename ValueType> const ValueType * any_cast(const any *);
>  template<typename ValueType> ValueType * any_cast(any *);

sure thing. If you look closely, any_cast is called from within my
code. However, when trying to using boost::any and boost::variant
interchangeably it is handy to have a common interface like the one
boost::get provides.

Christoph


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