Boost logo

Boost :

Subject: Re: [boost] [variant] Heads-up!
From: Matt Calabrese (rivorus_at_[hidden])
Date: 2019-04-29 21:03:23


On Mon, Apr 29, 2019 at 4:55 PM Nikita Kniazev <nok.raven_at_[hidden]> wrote:
>>
>> Would your problems also be solved if there were a separate type,
>> different from recursive_wrapper, that is similar but explicitly has
>> an empty state
>
>
> This can be done, but it leaves recursive_wrapper in the broken state for move only types and increases complexity of the variant.

Calling "recursive_wrapper" broken is a matter of debate, and I
suspect you're in the minority for that specific argument. For many,
recursive_wrapper itself is, on its own, okay. The less-controversial
statement is that there is no simple way to get the semantics that you
want, with the performance that you want. I suspect that the answer
may be closer to either a template that is different, but similar to
recursive_wrapper, or alternatively, a template that is similar but
different from a never-empty variant.

-- 
-Matt Calabrese

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