|
Boost : |
Subject: Re: [boost] [variant2] Andrzej's review -- design
From: Peter Dimov (pdimov_at_[hidden])
Date: 2019-04-03 01:20:11
Gavin Lambert wrote:
> Requiring that variants always possess an empty state dramatically
> simplifies implementation, including default construction and move
> assignment. And it avoids the valueless_by_exception kludge by promoting
> it to an entirely expected possible state of variant. (Thereby increasing
> the chance that consumers will consider it.)
That's more or less what using `monostate` as the first alternative
achieves.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk