Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2003-02-19 10:26:14


Eric Friedman wrote:
> Ed Brey wrote:
>> Please consider incorporating a "blank" type. This idea
>> would be to allow the equivalent of "void" to be added to the
>> type list. boost::blank (or whatever it would be called)
>> would be meet BoundedType concept, but otherwise do nothing.
>> The empty function would return true if a blank is currently stored.
>
> This is an interesting idea. It may even be possible to implement
> variant to detect a void type so that the following would be allowed:
>
> variant< T1, ... void, ... Tn >
>
> In the case of a variant "containing" void, empty() would return true,
> and visitation would be undefined.
>
> I'd be interested if others have opinions on this issue.

Supporting void as the first argument would also allow variants where none
of the types is DefaultConstructible. It is possible to fake that with
struct void_t {}; of course, but special-casing void may be clearer.


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