On Tue, May 6, 2008 at 6:31 PM, Igor R. <igor_rubinov@hotmail.com> wrote:

> At least what I read here is following:
> All instances v of type variant<T1,T2,...,TN> guarantee that v has constructed content of !!!one!!! of the types !!!Ti!!!, even if an operation on v has previously failed.
> For me it means that it can be T2 or TN as well.
 
Right, but the 1st link says:
"boost::variant< int, std::string > v;
By default, a variant default-constructs its first bounded type, so v initially contains int(0). If this is not desired, or if the first bounded type is not default-constructible, a variant can be constructed directly from any value convertible to one of its bounded types. "
Igor, I assume the following:
If the first type throws an exception while creation the second is created and so forth and the exception is probably not reported to you. Your pointer can be NULL in your previous example. Why don't you like visitor to dispatch the type stored in the variant?


Regards,
Ovanes