Boost logo

Boost :

Subject: Re: [boost] [variant]compile-time-checked boost::get<T>?
From: Arno Schödl (aschoedl_at_[hidden])
Date: 2008-12-11 04:11:15

>>> Actually, it should work with all types that are convertible from any
>>> of the types of the variant.
>> Would it work for a type that is convertible from two or more of
>> the types of the variant?
> It had better not compile in that case, unless one of the types is a
> better match
> than the rest.

I think that making this work would actually be desirable. For example, it would allow storing a base class together its derived class in the same variant.


Dr. Arno Schoedl · aschoedl_at_[hidden] 
Technical Director 
think-cell Software GmbH · Invalidenstr. 34 · 10115 Berlin, Germany · phone +49-30-666473-10 · toll-free (US) +1-800-891-8091
Directors: Dr. Markus Hannebauer, Dr. Arno Schoedl · Amtsgericht Charlottenburg, HRB 85229

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