|
Boost : |
Subject: Re: [boost] [variant] Basic rvalue and C++11 features support
From: Joel de Guzman (djowel_at_[hidden])
Date: 2013-01-20 10:52:48
On 1/12/13 7:54 AM, Joel de Guzman wrote:
> 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.
I am reopening this issue because I just got a notification that issue
7718 is being closed as "fixed"
https://svn.boost.org/trac/boost/ticket/7718
It seems the author of the patch (mistakenly) concluded that the current
"vote" is to keep the slow move implementation. IMO, that is wrong.
The current consensus (there was no such a vote AFAIK) is Peter's suggestion
(regarding the blank type) which makes a lot of sense.
If you care about move performance for variant, then by all means holler!
The current patch is not acceptable!
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