Boost logo

Boost :

Subject: Re: [boost] [variant] Basic rvalue and C++11 features support
From: Peter Dimov (lists_at_[hidden])
Date: 2013-01-11 10:19:28


Larry Evans wrote:
> Thanks for the clarification.
>
> However, that seems to involve a lot of checking because you'd have
> to check possibly all the bounded types to find one that
> is nothrow-default-constructible.

That's already what the copy constructor does. See the documentation on the
never-emtpy guarantee.

> Wouldn't it be simpler to define variant to have, implicitly, a
> nothrow-default-constructible type...

There's already such a type, boost::blank, but you need to include it
explicitly in the list of possible types. If it's present, variant will use
it to signify an empty variant. This is also explained on the aforementioned
page.


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