Boost logo

Boost Users :

Subject: Re: [Boost-users] [smart_ptr] Inclusion of unique_ptr
From: Michael Marcin (mike.marcin_at_[hidden])
Date: 2011-12-27 00:05:21


On 11/9/2011 5:09 PM, Peter Dimov wrote:
> Szymon Gatner wrote:
>> Hi,
>>
>> as suggested by Dave Abrahams I am now turning here with proposition
>> of including unique_ptr<> to smart_ptr library. Newly accepted
>> boost.move enables portable implementation and move-aware containers
>> in boost.container allow to take full advantage of this now standard
>> pointer type.
>>
>> Attaching proposed implementation.
>
> Hi Szymon,
>
> What you have looks good. However, for inclusion you'll need to provide
> tests and a documentation page. Ideally, the test(s) would follow the
> specification and test every feature against it, although something more
> abbreviated may be acceptable too, as long as it has reasonably good
> coverage of the typical uses. You should look at the existing shared_ptr
> tests as an example.

The proposed implementation doesn't work for VC10 and probably anything
that actually has rvalue references.

It might be enough to guard

unique_ptr_storage

operator rv<unique_ptr_storage>() {return rv<unique_ptr_storage>(*this);}

with

#ifdef BOOST_NO_RVALUE_REFERENCES

I didn't look closely enough to be sure.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net