Boost logo

Boost :

Subject: [boost] [variant2] documentation request
From: Andrzej Krzemienski (akrzemi1_at_[hidden])
Date: 2019-03-02 12:18:33


Hi Peter,
Given that the never-empty guarantee appears to be at the heart of the
motivation for boost::variant2, I would suggest to:
1. put in the documentation some motivation behind pursuing the never-empty
guarantee.
2. Make it clear that never-empty guarantee is not a strong
exception-safety guarantee.
3. Describe the algorithm for achieving the guarantee. The current
description does not seem to cover all interesting cases, and I found the
behavior quite surprising. For instance, the variant's move assignment will
sometimes use T's move assignment rather than move constructor when
changing the variant's type, as in the following example:

https://wandbox.org/permlink/GDRyS54bpdLP7GVa

Regards,
Andrzej


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