|
Boost : |
Subject: Re: [boost] [variant] Basic rvalue and C++11 features support
From: Joel de Guzman (djowel_at_[hidden])
Date: 2013-01-11 18:54:08
On 1/11/13 11:02 PM, Paul Smith wrote:
> On Fri, Jan 11, 2013 at 4:18 PM, Peter Dimov <lists_at_[hidden]> 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
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk