> At least what I read here is following:> All instancesRight, but the 1st link says:v
of typevariant<T1,T2,...,TN>
guarantee thatv
has constructed content of !!!one!!! of the types!!!Ti!!!
, even if an operation onv
has previously failed.
> For me it means that it can be T2 or TN as well.
"boost::variant< int, std::string > v;
By default, avariant
default-constructs its first bounded type, sov
initially containsint(0)
. If this is not desired, or if the first bounded type is not default-constructible, avariant
can be constructed directly from any value convertible to one of its bounded types. "