
On 1/11/13 11:02 PM, Paul Smith wrote:
On Fri, Jan 11, 2013 at 4:18 PM, Peter Dimov <lists@pdimov.com> wrote:
If the variant could be empty, or equivalently, if the variant always contained a type that can be reliably default-constructed (without an exception) such as int, the problems with assignment (both copy- and move-) and with move construction do not occur, because the target can be left holding the int.
So, one option is to enable move only in this case.
That's the first constructive solution so far. Something like:
template <typename T> struct is_legitimate_move_target // specialize me : has_trivial_constructor<T> {};
Paul, I agree! Peter, I like the direction this is heading to. I really appreciate your interest in this. Regards, -- Joel de Guzman http://www.boostpro.com http://boost-spirit.com