10 Apr
2019
10 Apr
'19
1:03 p.m.
Andrzej Krzemienski wrote: ...
Consider the following example:
``` struct X {};
struct Guard { explicit Guard(int) {} Guard(Guard&&) = delete; };
variant
v {}; v.emplace<Guard>(1); ``` ... 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?
It's fixed in https://github.com/pdimov/variant2/commit/9f7e525984ac87ccb90799c9bb2283946d....
Go double-buffer in this case?
There's no reason to double-buffer here, because X is nothrow default constructible, so it can be used as a fallback type.