Boost logo

Boost :

Subject: Re: [boost] [variant] Maintainer
From: Larry Evans (cppljevans_at_[hidden])
Date: 2015-07-14 14:17:02


On 07/14/2015 01:03 PM, Peter Dimov wrote:
> Larry Evans wrote:
>> >> What about variant<>, or is that disallowed?
>> >> If it is disallowed, then tuple<> should, I guess, also be disallowed.
>
> variant<T1,...,Tn> has N(T1)+N(T2)+...+N(Tn) valid values, whereas
> tuple<T1,...,Tn> has N(T1)*N(T2)*...*N(Tn) valid values, where N(T) is
> the number of valid values T has. It follows that variant<> has zero
> valid values, whereas tuple<> has one.
>
Thanks Peter.

To be explicit:

  tuple<> t0;

would be allowed, but:

  variant<> v0;

wouldn't compile because there are "zero valid values"
in a variant<>?


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