niedz., 7 kwi 2019 o 05:33 Peter Dimov via Boost
Andrzej Krzemienski wrote:
Consider the following example:
``` struct X {};
struct Guard { explicit Guard(int) {} Guard(Guard&&) = delete; };
variant
v {}; v.emplace<Guard>(1); ``` This works fine with std::variant, but fails to compile with variant2::variant, because the latter requires all the alternative types, at least in one implementaiton of the never-empty trick, to be move-constructible. But this requirement is never listed in either global requirements for alternative types stored in variant, or in the specification of functions `emplace()`.
The documentation is correct, the implementation is wrong here; this should work and the fact that it doesn't is a bug. Thanks.
Might I ask how you plan to fix this bug? Go double-buffer in this case? Regards, &rzej;