|
Boost : |
Subject: Re: [boost] boost::optional -- updates for C++11 move semantics
From: Mathias Gaunard (mathias.gaunard_at_[hidden])
Date: 2013-02-05 11:45:38
On 05/02/13 17:09, Diggory Hardy wrote:
> On Tuesday 05 February 2013 16:44:55 Mathias Gaunard wrote:
>> On 05/02/13 15:26, Diggory Hardy wrote:
>>> Dear list,
>>>
>>> I wanted something like boost::optional, but with support for move-
>>> construction/assignment, so I went ahead and had a go at patching it.
>>>
>>> Attached is based on boost 1.49 (Ubuntu package). Could someone please
>>> review? I've not contributed to boost before. The changes at least aren't
>>> too complicated, but:
>>> 1) I'm not entirely sure if the move constructor (line 636) and swap
>>> function (line 1046) are implemented in the best way (also see line 279),
>>> 2) and I have no idea how is_[not_]reference_tag (line 486) works.
>>> 3) There should maybe also be a unit test.
>>>
>>> Of course, I am happy for my contributions to be published under the boost
>>> licence.
>>
>> I recommend that you give your changes as a diff rather than give the
>> new version of the files.
>
> As you like.
>
I'm not the maintainer of this library, but I can see a problem: your
code is not compatible with C++03 anymore.
You should only add this C++11-specific code when this particular C++11
feature is supported.
You can use #ifndef BOOST_NO_RVALUE_REFERENCES for this.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk