Boost logo

Boost :

Subject: Re: [boost] [move][unique_ptr] c++14 unique_ptr comes to town
From: Ion Gaztañaga (igaztanaga_at_[hidden])
Date: 2014-08-27 17:41:25


El 26/08/2014 23:36, Peter Dimov escribió:
> Ion Gaztañaga wrote:
>
>> Evidently, if tests are finer grained separated then we can push
>> Boost.Move out of many tests. In any case, it will be included by
>> boost/move/unique_ptr.hpp ;-)
>
> This is an implementation detail. We may decide (either now or at some
> point in the future) to not include Boost.Move in C++11 mode at all in
> unique_ptr.hpp. And if we do that, it will help if we test whether both
>
> p1 = std::move( p2 );
>
> and
>
> p1 = boost::move( p2 );
>
> work (the former in C++11 mode, the latter in both 03 and 11 with
> appropriate #include <move/core_utility.hpp>.)

We can execute the test with some macro specifying (in C++11) if we want
to test it using boost move or not. That would cover both C++11 and
Boost.Move users writing portable C+++03/C++11 code.

> Stated differently, I want boost::unique_ptr, on a C++11 compiler, to
> work without any inclusion or mention of Boost.Move in user code, if
> that's what the user wants (even though it wouldn't make much sense to
> not use std::unique_ptr there except perhaps for the <T[N]> extension,
> but still.)

That's possible at this moment, although it is not being tested.

> Something I missed in my post is that I think that default_delete should
> be in its own header (and its test should be named default_delete_test.)

While I haven't split this into another header, the latest commit,
removes the array specialization, tidies doxygen macros with other macro
utilities and the readability of the implementation has been improved as
the header has much less code:

https://github.com/boostorg/move/blob/develop/include/boost/move/unique_ptr.hpp

unique_ptr is also now constructible and assignable from zero in c++03 code.

Tested in several GCC, MSVC and Clang versions, both in C++03 and C++11
modes. I won't have time in the following days to continue working in
your proposed changes, but at least I wanted to to show that we've
progressed a bit.

Best,

Ion


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk