Boost logo

Boost :

From: Douglas Gregor (gregod_at_[hidden])
Date: 2002-06-30 15:56:58

On Sunday 30 June 2002 03:23 pm, Itay wrote:
> I like pretty much the comparison with auto_ptr::release(). However, this
> brings up the following question:
> Since variant's interface is practically compatible with boost::any's, why
> don't we rename variant_cast to any_cast ?
> This way, porting an existing code from any to variant,
> will basically require the developer to change a single #include line and a
> typedef statement.
> -Itay

I'd be inclined to go the other way: create variant_cast, but also supply a
boost::any overload of variant_cast that is a thin wrapper around any_cast.
The reason is one of pure naming: a variant doesn't take 'any' type, it takes
any of a set of types, whereas boost::any is a variant type (an unbounded
one) as is the variant we're discussing. Basically, I think 'variant_cast' is
a better name for all variant types whereas 'any_cast' is only suitable for


Boost list run by bdawes at, gregod at, cpdaniel at, john at