void `T &` `T &`

Exchanges the values of a and b, using Argument Dependent Lookup (ADL) to select a specialized swap function if available. If no specialized swap function is available, std::swap is used.

Exception: If T uses Boost.Move's move emulation and the compiler has no rvalue references then:

- If T has a `T::swap(T&)` member, that member is called.

- Otherwise a move-based swap is called, equivalent to: `T t(::boost::move(x)); x = ::boost::move(y); y = ::boost::move(t);`.

ForwardIt2 `ForwardIt1` `ForwardIt1` `ForwardIt2`

Exchanges elements between range [first1, last1) and another range starting at first2 using boost::adl_move_swap.

Parameters: first1, last1 - the first range of elements to swap first2 - beginning of the second range of elements to swap

Type requirements:

- ForwardIt1, ForwardIt2 must meet the requirements of ForwardIterator.

- The types of dereferenced ForwardIt1 and ForwardIt2 must meet the requirements of Swappable

Return value: Iterator to the element past the last element exchanged in the range beginning with first2.

BidirIt2 `BidirIt1` `BidirIt1` `BidirIt2`
void `RandIt` `RandIt` `RandIt` `Compare` `typename iterator_traits< RandIt >::value_type *0` `std::size_t0`

Effects: Merges two consecutive sorted ranges [first, middle) and [middle, last) into one sorted range [first, last) according to the given comparison function comp. The algorithm is stable (if there are equivalent elements in the original two ranges, the elements from the first range (preserving their original order) precede the elements from the second range (preserving their original order).

Requires:

- RandIt must meet the requirements of ValueSwappable and RandomAccessIterator.

- The type of dereferenced RandIt must meet the requirements of MoveAssignable and MoveConstructible.

Parameters:

- first: the beginning of the first sorted range.

- middle: the end of the first sorted range and the beginning of the second

- last: the end of the second sorted range

- comp: comparison function object which returns true if the first argument is is ordered before the second.

- uninitialized, uninitialized_len: raw storage starting on "uninitialized", able to hold "uninitialized_len" elements of type iterator_traits<RandIt>::value_type. Maximum performance is achieved when uninitialized_len is min(std::distance(first, middle), std::distance(middle, last)).

Throws: If comp throws or the move constructor, move assignment or swap of the type of dereferenced RandIt throws.

Complexity: Always K x O(N) comparisons and move assignments/constructors/swaps. Constant factor for comparisons and data movement is minimized when uninitialized_len is min(std::distance(first, middle), std::distance(middle, last)). Pretty good enough performance is achieved when uninitialized_len is ceil(sqrt(std::distance(first, last)))*2.

Caution: Experimental implementation, not production-ready.

void `RandIt` `RandIt` `Compare` `RandRawIt` `std::size_t`

Effects: Sorts the elements in the range [first, last) in ascending order according to comparison functor "comp". The sort is stable (order of equal elements is guaranteed to be preserved). Performance is improved if additional raw storage is provided.

Requires:

- RandIt must meet the requirements of ValueSwappable and RandomAccessIterator.

- The type of dereferenced RandIt must meet the requirements of MoveAssignable and MoveConstructible.

Parameters:

- first, last: the range of elements to sort

- comp: comparison function object which returns true if the first argument is is ordered before the second.

- uninitialized, uninitialized_len: raw storage starting on "uninitialized", able to hold "uninitialized_len" elements of type iterator_traits<RandIt>::value_type. Maximum performance is achieved when uninitialized_len is ceil(std::distance(first, last)/2).

Throws: If comp throws or the move constructor, move assignment or swap of the type of dereferenced RandIt throws.

Complexity: Always K x O(Nxlog(N)) comparisons and move assignments/constructors/swaps. Comparisons are close to minimum even with no additional memory. Constant factor for data movement is minimized when uninitialized_len is ceil(std::distance(first, last)/2). Pretty good enough performance is achieved when ceil(sqrt(std::distance(first, last)))*2.

Caution: Experimental implementation, not production-ready.

void `RandIt` `RandIt` `Compare`
bool `const U &` `const V &`
Comp &
antistable & `const antistable &`
bool `const T1 &` `const T2 &`
Comp
bool `const T1 &` `const T2 &`
Comp
ForwardIterator `ForwardIterator` `ForwardIterator` `BinaryPredicate`

Requires: The comparison function shall be an equivalence relation. The type of *first shall satisfy the MoveAssignable requirements

Effects: For a nonempty range, eliminates all but the first element from every consecutive group of equivalent elements referred to by the iterator i in the range [first + 1, last) for which the following conditions hold: pred(*(i - 1), *i) != false.

Returns: The end of the resulting range.

Complexity: For nonempty ranges, exactly (last - first) - 1 applications of the corresponding predicate.

F `I` `I` `F` `unspecified0`
F `I` `I` `F` `unspecified0`
F `I` `I` `F`

Effects:

    for (; first != last; ++result, ++first)
       new (static_cast<void*>(&*result))
          typename iterator_traits<ForwardIterator>::value_type(*first);

Returns: result

Note: This function is provided because std::uninitialized_copy from some STL implementations is not compatible with `move_iterator`

F `I` `I` `F`

Effects:

    for (; first != last; ++result, ++first)
       *result = *first;

Returns: result

Note: This function is provided because std::uninitialized_copy from some STL implementations is not compatible with `move_iterator`

This header implements macros to define movable classes and move-aware functions

This trait yields to a compile-time true boolean if T was marked as BOOST_MOVABLE_BUT_NOT_COPYABLE or BOOST_COPYABLE_AND_MOVABLE and rvalue references are not available on the platform. False otherwise.

const bool
const bool

This macro marks a type as movable but not copyable, disabling copy construction and assignment. The user will need to write a move constructor/assignment as explained in the documentation to fully write a movable but not copyable class.

This macro marks a type as copyable and movable. The user will need to write a move constructor/assignment and a copy assignment as explained in the documentation to fully write a copyable and movable class.

This macro is used to achieve portable syntax in move constructors and assignments for classes marked as BOOST_COPYABLE_AND_MOVABLE or BOOST_MOVABLE_BUT_NOT_COPYABLE

This macro is used to achieve portable syntax in move constructors and assignments for template classes marked as BOOST_COPYABLE_AND_MOVABLE or BOOST_MOVABLE_BUT_NOT_COPYABLE. As macros have problems with comma-separated template arguments, the template argument must be preceded with BOOST_RV_REF_BEG and ended with BOOST_RV_REF_END

This macro is used to achieve portable syntax in move constructors and assignments for template classes marked as BOOST_COPYABLE_AND_MOVABLE or BOOST_MOVABLE_BUT_NOT_COPYABLE. As macros have problems with comma-separated template arguments, the template argument must be preceded with BOOST_RV_REF_BEG and ended with BOOST_RV_REF_END

This macro expands to BOOST_RV_REF_BEG if BOOST_NO_CXX11_RVALUE_REFERENCES is not defined, empty otherwise

This macro expands to BOOST_RV_REF_END if BOOST_NO_CXX11_RVALUE_REFERENCES is not defined, empty otherwise

This macro is used to achieve portable syntax in copy assignment for classes marked as BOOST_COPYABLE_AND_MOVABLE.

This macro is used to implement portable perfect forwarding as explained in the documentation.

This macro is used to achieve portable move return semantics. The C++11 Standard allows implicit move returns when the object to be returned is designated by a lvalue and:

- The criteria for elision of a copy operation are met OR

- The criteria would be met save for the fact that the source object is a function parameter

For C++11 conforming compilers this macros only yields to REF: `return BOOST_MOVE_RET(RET_TYPE, REF);` -> `return REF;`

For compilers without rvalue references this macro does an explicit move if the move emulation is activated and the return type (RET_TYPE) is not a reference.

For non-conforming compilers with rvalue references like Visual 2010 & 2012, an explicit move is performed if RET_TYPE is not a reference.

Caution: When using this macro in non-conforming or C++03 compilers, a move will be performed even if the C++11 standard does not allow it (e.g. returning a static variable). The user is responsible for using this macro only to return local objects that met C++11 criteria.

defined(BOOST_MOVE_MSVC_AUTO_MOVE_RETURN_BUG) || defined(BOOST_MOVE_DOXYGEN_INVOKED)

This macro is used to achieve portable optimal move constructors.

When implementing the move constructor, in C++03 compilers the moved-from argument must be cast to the base type before calling `boost::move()` due to rvalue reference limitations.

In C++11 compilers the cast from a rvalue reference of a derived type to a rvalue reference of a base type is implicit.

Describes the default deleter (destruction policy) of `unique_ptr`: `default_delete`.

The type to be deleted. It may be an incomplete type

The class template ``default_delete`` serves as the default deleter (destruction policy) for the class template ``unique_ptr``.

void `U *`

Effects: if T is not an array type, calls `delete` on static_cast<T*>(ptr), otherwise calls `delete[]` on static_cast<remove_extent<T>::type*>(ptr).

Remarks: If U is an incomplete type, the program is ill-formed. This operator shall not participate in overload resolution unless:

- T is not an array type and U* is convertible to T*, OR

- T is an array type, and remove_cv<U>::type is the same type as remove_cv<remove_extent<T>::type>::type and U* is convertible to remove_extent<T>::type*.

void `std::nullptr_t`

Effects: Same as `(this)(static_cast<element_type>(nullptr))`.

Default constructor.

const `default_delete` &

Trivial copy constructor

`default_delete` & `const `default_delete` &`

Trivial assignment

const `default_delete`< U > &

Effects: Constructs a `default_delete` object from another `default_delete<U>` object.

Remarks: This constructor shall not participate in overload resolution unless:

- If T is not an array type and U* is implicitly convertible to T*.

- If T is an array type and U* is a more CV qualified pointer to remove_extent<T>::type.

`default_delete` & `const `default_delete`< U > &`

Effects: Constructs a `default_delete` object from another `default_delete<U>` object.

Remarks: This constructor shall not participate in overload resolution unless:

- If T is not an array type and U* is implicitly convertible to T*.

- If T is an array type and U* is a more CV qualified pointer to remove_extent<T>::type.

Class template `move_iterator` is an iterator adaptor with the same behavior as the underlying iterator except that its dereference operator implicitly converts the value returned by the underlying iterator's dereference operator to an rvalue reference. Some generic algorithms can be called with move iterators to replace copying with moving.

It
boost::movelib::iterator_traits< iterator_type >::value_type
value_type &&
It
boost::movelib::iterator_traits< iterator_type >::difference_type
boost::movelib::iterator_traits< iterator_type >::iterator_category
reference
pointer
`move_iterator` &
`move_iterator`< iterator_type > `int`
`move_iterator` &
`move_iterator`< iterator_type > `int`
`move_iterator`< iterator_type > `difference_type`
`move_iterator` & `difference_type`
`move_iterator`< iterator_type > `difference_type`
`move_iterator` & `difference_type`
reference `difference_type`
const It &
const `move_iterator`< U > &

A move insert iterator that move constructs elements at the back of a container

C
C::value_type
C::reference
C::pointer
C::difference_type
std::output_iterator_tag
`back_move_insert_iterator` &
`back_move_insert_iterator` &
`back_move_insert_iterator` & `int`
C &
`back_move_insert_iterator` & `reference`
`back_move_insert_iterator` & `value_type &&`

A move insert iterator that move constructs elements int the front of a container

C
C::value_type
C::reference
C::pointer
C::difference_type
std::output_iterator_tag
`front_move_insert_iterator` &
`front_move_insert_iterator` &
`front_move_insert_iterator` & `int`
C &
`front_move_insert_iterator` & `reference`
`front_move_insert_iterator` & `value_type &&`
C
C::value_type
C::reference
C::pointer
C::difference_type
std::output_iterator_tag
move_insert_iterator &
move_insert_iterator &
move_insert_iterator & `int`
C &
typename C::iterator
move_insert_iterator & `reference`
move_insert_iterator & `value_type &&`
`move_iterator`< It > `const It &`

Returns: move_iterator<It>(i).

`back_move_insert_iterator`< C > `C &`

Returns: back_move_insert_iterator<C>(x).

`front_move_insert_iterator`< C > `C &`

Returns: front_move_insert_iterator<C>(x).

move_insert_iterator< C > `C &` `typename C::iterator`

Returns: move_insert_iterator<C>(x, it).

Defines "make_unique" functions, which are factories to create instances of unique_ptr depending on the passed arguments.

This header can be a bit heavyweight in C++03 compilers due to the use of the preprocessor library, that's why it's a a separate header from `unique_ptr.hpp`

`unique_ptr`< T > class... `Args &&...`

Remarks: This function shall not participate in overload resolution unless T is not an array.

Returns: `unique_ptr<T>(new T(std::forward<Args>(args)...))`.

`unique_ptr`< T > class... `Args &&...`

Remarks: This function shall not participate in overload resolution unless T is not an array.

Returns: `unique_ptr<T>(new T(std::nothrow)(std::forward<Args>(args)...))`.

`unique_ptr`< T >

Remarks: This function shall not participate in overload resolution unless T is not an array.

Returns: `unique_ptr<T>(new T)` (default initialization)

`unique_ptr`< T >

Remarks: This function shall not participate in overload resolution unless T is not an array.

Returns: `unique_ptr<T>(new T(std::nothrow)` (default initialization)

`unique_ptr`< T > `std::size_t`

Remarks: This function shall not participate in overload resolution unless T is an array of unknown bound.

Returns: `unique_ptr<T>(new remove_extent_t<T>[n]())` (value initialization)

`unique_ptr`< T > `std::size_t`

Remarks: This function shall not participate in overload resolution unless T is an array of unknown bound.

Returns: `unique_ptr<T>(new (std::nothrow)remove_extent_t<T>[n]())` (value initialization)

`unique_ptr`< T > `std::size_t`

Remarks: This function shall not participate in overload resolution unless T is an array of unknown bound.

Returns: `unique_ptr<T>(new remove_extent_t<T>[n])` (default initialization)

`unique_ptr`< T > `std::size_t`

Remarks: This function shall not participate in overload resolution unless T is an array of unknown bound.

Returns: `unique_ptr<T>(new (std::nothrow)remove_extent_t<T>[n])` (default initialization)

unspecified class... `Args &&`

Remarks: This function shall not participate in overload resolution unless T is an array of known bound.

unspecified class... `Args &&`

Remarks: This function shall not participate in overload resolution unless T is an array of known bound.

unspecified class... `Args &&`

Remarks: This function shall not participate in overload resolution unless T is an array of known bound.

unspecified class... `Args &&`

Remarks: This function shall not participate in overload resolution unless T is an array of known bound.

A general library header that includes the rest of top-level headers.

O `I` `I` `O`

Effects: Moves elements in the range [first,last) into the range [result,result + (last - first)) starting from first and proceeding to last. For each non-negative integer n < (last-first), performs *(result + n) = boost::move (*(first + n)).

Effects: result + (last - first).

Requires: result shall not be in the range [first,last).

Complexity: Exactly last - first move assignments.

O `I` `I` `O`

Effects: Moves elements in the range [first,last) into the range [result - (last-first),result) starting from last - 1 and proceeding to first. For each positive integer n <= (last - first), performs *(result - n) = boost::move(*(last - n)).

Requires: result shall not be in the range [first,last).

Returns: result - (last - first).

Complexity: Exactly last - first assignments.

F `I` `I` `F` defined(BOOST_MOVE_USE_STANDARD_LIBRARY_MOVE)

Effects:

    for (; first != last; ++result, ++first)
       new (static_cast<void*>(&*result))
          typename iterator_traits<ForwardIterator>::value_type(boost::move(*first));

Returns: result

If this trait yields to true (`has_trivial_destructor_after_move` <T>::value == true) means that if T is used as argument of a move construction/assignment, there is no need to call T's destructor. This optimization tipically is used to improve containers' performance.

By default this trait is true if the type has trivial destructor, every class should specialize this trait if it wants to improve performance when inserted in containers.

    boost::is_nothrow_move_constructible<T>::value && boost::is_nothrow_move_assignable<T>::value

const bool

Describes the smart pointer unique_ptr, a drop-in replacement for std::unique_ptr, usable also from C++03 compilers.

Main differences from std::unique_ptr to avoid heavy dependencies, specially in C++03 compilers:

- `operator <` uses pointer `operator <` instead of `std::less<common_type>`. This avoids dependencies on `std::common_type` and `std::less` (`<type_traits>/<functional>` headers). In C++03 this avoid pulling Boost.Typeof and other cascading dependencies. As in all Boost platforms `operator <` on raw pointers and other smart pointers provides strict weak ordering in practice this should not be a problem for users.

- assignable from literal 0 for compilers without nullptr

- `unique_ptr<T[]>` is constructible and assignable from `unique_ptr<U[]>` if cv-less T and cv-less U are the same type and T is more CV qualified than U.

Provides the type of the stored pointer.

boost::movelib::default_delete

default_delete
<T>

The deleter type:

- The default type for the template parameter D is `default_delete`. A client-supplied template argument D shall be a function object type, lvalue-reference to function, or lvalue-reference to function object type for which, given a value d of type D and a value ptr of type unique_ptr<T, D>::pointer, the expression d(ptr) is valid and has the effect of disposing of the pointer as appropriate for that deleter.

- If the deleter's type D is not a reference type, D shall satisfy the requirements of Destructible.

- If the type `remove_reference<D>::type::pointer` exists, it shall satisfy the requirements of NullablePointer.

A unique pointer is an object that owns another object and manages that other object through a pointer.

More precisely, a unique pointer is an object u that stores a pointer to a second object p and will dispose of p when u is itself destroyed (e.g., when leaving block scope). In this context, u is said to own p.

The mechanism by which u disposes of p is known as p's associated deleter, a function object whose correct invocation results in p's appropriate disposition (typically its deletion).

Let the notation u.p denote the pointer stored by u, and let u.d denote the associated deleter. Upon request, u can reset (replace) u.p and u.d with another pointer and deleter, but must properly dispose of its owned object via the associated deleter before such replacement is considered completed.

Additionally, u can, upon request, transfer ownership to another unique pointer u2. Upon completion of such a transfer, the following postconditions hold:

- u2.p is equal to the pre-transfer u.p,

- u.p is equal to nullptr, and

- if the pre-transfer u.d maintained state, such state has been transferred to u2.d.

As in the case of a reset, u2 must properly dispose of its pre-transfer owned object via the pre-transfer associated deleter before the ownership transfer is considered complete.

Each object of a type U instantiated from the `unique_ptr` template specified in this subclause has the strict ownership semantics, specified above, of a unique pointer. In partial satisfaction of these semantics, each such U is MoveConstructible and MoveAssignable, but is not CopyConstructible nor CopyAssignable. The template parameter T of `unique_ptr` may be an incomplete type.

The uses of `unique_ptr` include providing exception safety for dynamically allocated memory, passing ownership of dynamically allocated memory to a function, and returning dynamically allocated memory from a function.

If T is an array type (e.g. unique_ptr<MyType[]>) the interface is slightly altered:

- Pointers to types derived from T are rejected by the constructors, and by reset.

- The observers `operator*` and `operator->` are not provided.

- The indexing observer `operator[]` is provided.

If the type `remove_reference<D>::type::pointer` exists, then it shall be a synonym for `remove_reference<D>::type::pointer`. Otherwise it shall be a synonym for T*.

see_documentation

If T is an array type, then element_type is equal to T. Otherwise, if T is a type in the form U[], element_type is equal to U.

see_documentation
D
element_type &

Requires: `get() != nullptr`.

Returns: `*get()`.

Remarks</b: If T is an array type, the program is ill-formed.

element_type & `std::size_t`

Requires: i < the number of elements in the array to which the stored pointer points.

Returns: `get()[i]`.

Remarks</b: If T is not an array type, the program is ill-formed.

pointer

Requires: `get() != nullptr`.

Returns: `get()`.

Note: use typically requires that T be a complete type.

Remarks</b: If T is an array type, the program is ill-formed.

pointer

Returns: The stored pointer.

D &

Returns: A reference to the stored deleter.

const D &

Returns: A reference to the stored deleter.

bool

Returns: Returns: get() != nullptr.

pointer

Postcondition: `get() == nullptr`.

Returns: The value `get()` had at the start of the call to release.

void `Pointer`

Requires: The expression `get_deleter()(get())` shall be well formed, shall have well-defined behavior, and shall not throw exceptions.

Effects: assigns p to the stored pointer, and then if the old value of the stored pointer, old_p, was not equal to nullptr, calls `get_deleter()(old_p)`. Note: The order of these operations is significant because the call to `get_deleter()` may destroy *this.

Postconditions: `get() == p`. Note: The postcondition does not hold if the call to `get_deleter()` destroys *this since `this->get()` is no longer a valid expression.

Remarks: This constructor shall not participate in overload resolution unless:

- If T is not an array type and Pointer is implicitly convertible to pointer.

- If T is an array type and Pointer is a more CV qualified pointer to element_type.

void

Requires: The expression `get_deleter()(get())` shall be well formed, shall have well-defined behavior, and shall not throw exceptions.

Effects: assigns nullptr to the stored pointer, and then if the old value of the stored pointer, old_p, was not equal to nullptr, calls `get_deleter()(old_p)`. Note: The order of these operations is significant because the call to `get_deleter()` may destroy *this.

Postconditions: `get() == p`. Note: The postcondition does not hold if the call to `get_deleter()` destroys *this since `this->get()` is no longer a valid expression.

void `std::nullptr_t`

Effects: Same as `reset()`

void ``unique_ptr` &`

Requires: `get_deleter()` shall be swappable and shall not throw an exception under swap.

Effects: Invokes swap on the stored pointers and on the stored deleters of *this and u.

const `unique_ptr` &
`unique_ptr` & `const `unique_ptr` &`

Requires: D shall satisfy the requirements of DefaultConstructible, and that construction shall not throw an exception.

Effects: Constructs a `unique_ptr` object that owns nothing, value-initializing the stored pointer and the stored deleter.

Postconditions: `get() == nullptr`. `get_deleter()` returns a reference to the stored deleter.

Remarks: If this constructor is instantiated with a pointer type or reference type for the template argument D, the program is ill-formed.

std::nullptr_t

Effects: Same as `unique_ptr()` (default constructor).

Pointer

Requires: D shall satisfy the requirements of DefaultConstructible, and that construction shall not throw an exception.

Effects: Constructs a `unique_ptr` which owns p, initializing the stored pointer with p and value initializing the stored deleter.

Postconditions: `get() == p`. `get_deleter()` returns a reference to the stored deleter.

Remarks: If this constructor is instantiated with a pointer type or reference type for the template argument D, the program is ill-formed. This constructor shall not participate in overload resolution unless:

- If T is not an array type and Pointer is implicitly convertible to pointer.

- If T is an array type and Pointer is a more CV qualified pointer to element_type.

Pointer
see_documentation

The signature of this constructor depends upon whether D is a reference type.

- If D is non-reference type A, then the signature is `unique_ptr(pointer p, const A& d)`.

- If D is an lvalue-reference type A&, then the signature is `unique_ptr(pointer p, A& d)`.

- If D is an lvalue-reference type const A&, then the signature is `unique_ptr(pointer p, const A& d)`.

Requires: Either

- D is not an lvalue-reference type and d is an lvalue or const rvalue. D shall satisfy the requirements of CopyConstructible, and the copy constructor of D shall not throw an exception. This `unique_ptr` will hold a copy of d.

- D is an lvalue-reference type and d is an lvalue. the type which D references need not be CopyConstructible nor MoveConstructible. This `unique_ptr` will hold a D which refers to the lvalue d.

Effects: Constructs a `unique_ptr` object which owns p, initializing the stored pointer with p and initializing the deleter as described above.

Postconditions: `get() == p`. `get_deleter()` returns a reference to the stored deleter. If D is a reference type then `get_deleter()` returns a reference to the lvalue d.

Remarks: This constructor shall not participate in overload resolution unless:

- If T is not an array type and Pointer is implicitly convertible to pointer.

- If T is an array type and Pointer is a more CV qualified pointer to element_type.

std::nullptr_t
see_documentation

Effects: Same effects as `template<class Pointer> unique_ptr(Pointer p, deleter_arg_type1 d1)` and additionally `get() == nullptr`

Pointer
see_documentation

The signature of this constructor depends upon whether D is a reference type.

- If D is non-reference type A, then the signature is `unique_ptr(pointer p, A&& d)`.

- If D is an lvalue-reference type A&, then the signature is `unique_ptr(pointer p, A&& d)`.

- If D is an lvalue-reference type const A&, then the signature is `unique_ptr(pointer p, const A&& d)`.

Requires: Either

- D is not an lvalue-reference type and d is a non-const rvalue. D shall satisfy the requirements of MoveConstructible, and the move constructor of D shall not throw an exception. This `unique_ptr` will hold a value move constructed from d.

- D is an lvalue-reference type and d is an rvalue, the program is ill-formed.

Effects: Constructs a `unique_ptr` object which owns p, initializing the stored pointer with p and initializing the deleter as described above.

Postconditions: `get() == p`. `get_deleter()` returns a reference to the stored deleter. If D is a reference type then `get_deleter()` returns a reference to the lvalue d.

Remarks: This constructor shall not participate in overload resolution unless:

- If T is not an array type and Pointer is implicitly convertible to pointer.

- If T is an array type and Pointer is a more CV qualified pointer to element_type.

std::nullptr_t
see_documentation

Effects: Same effects as `template<class Pointer> unique_ptr(Pointer p, deleter_arg_type2 d2)` and additionally `get() == nullptr`

unique_ptr
&&

Requires: If D is not a reference type, D shall satisfy the requirements of MoveConstructible. Construction of the deleter from an rvalue of type D shall not throw an exception.

Effects: Constructs a `unique_ptr` by transferring ownership from u to *this. If D is a reference type, this deleter is copy constructed from u's deleter; otherwise, this deleter is move constructed from u's deleter.

Postconditions: `get()` yields the value u.get() yielded before the construction. `get_deleter()` returns a reference to the stored deleter that was constructed from u.get_deleter(). If D is a reference type then `get_deleter()` and `u.get_deleter()` both reference the same lvalue deleter.

BOOST_RV_REF_BEG_IF_CXX11 `unique_ptr`< U, E > BOOST_RV_REF_END_IF_CXX11

Requires: If E is not a reference type, construction of the deleter from an rvalue of type E shall be well formed and shall not throw an exception. Otherwise, E is a reference type and construction of the deleter from an lvalue of type E shall be well formed and shall not throw an exception.

Remarks: This constructor shall not participate in overload resolution unless:

- `unique_ptr<U, E>::pointer` is implicitly convertible to pointer,

- U is not an array type, and

- either D is a reference type and E is the same type as D, or D is not a reference type and E is implicitly convertible to D.

Effects: Constructs a `unique_ptr` by transferring ownership from u to *this. If E is a reference type, this deleter is copy constructed from u's deleter; otherwise, this deleter is move constructed from u's deleter.

Postconditions: `get()` yields the value `u.get()` yielded before the construction. `get_deleter()` returns a reference to the stored deleter that was constructed from `u.get_deleter()`.

Requires: The expression `get_deleter()(get())` shall be well formed, shall have well-defined behavior, and shall not throw exceptions.

Effects: If `get() == nullpt1r` there are no effects. Otherwise `get_deleter()(get())`.

Note: The use of `default_delete` requires T to be a complete type

`unique_ptr` & ``unique_ptr` &&`

Requires: If D is not a reference type, D shall satisfy the requirements of MoveAssignable and assignment of the deleter from an rvalue of type D shall not throw an exception. Otherwise, D is a reference type; `remove_reference<D>::type` shall satisfy the CopyAssignable requirements and assignment of the deleter from an lvalue of type D shall not throw an exception.

Effects: Transfers ownership from u to *this as if by calling `reset(u.release())` followed by `get_deleter() = std::forward<D>(u.get_deleter())`.

Returns: *this.

`unique_ptr` & ``unique_ptr`< U, E > &&`

Requires: If E is not a reference type, assignment of the deleter from an rvalue of type E shall be well-formed and shall not throw an exception. Otherwise, E is a reference type and assignment of the deleter from an lvalue of type E shall be well-formed and shall not throw an exception.

Remarks: This operator shall not participate in overload resolution unless:

- `unique_ptr<U, E>::pointer` is implicitly convertible to pointer and

- U is not an array type.

Effects: Transfers ownership from u to *this as if by calling `reset(u.release())` followed by `get_deleter() = std::forward<E>(u.get_deleter())`.

Returns: *this.

`unique_ptr` & `std::nullptr_t`

Effects: `reset()`.

Postcondition: `get() == nullptr`

Returns: *this.

void ``unique_ptr`< T, D > &` ``unique_ptr`< T, D > &`

Effects: Calls `x.swap(y)`.

bool `const `unique_ptr`< T1, D1 > &` `const `unique_ptr`< T2, D2 > &`

Returns: `x.get() == y.get()`.

bool `const `unique_ptr`< T1, D1 > &` `const `unique_ptr`< T2, D2 > &`

Returns: `x.get() != y.get()`.

bool `const `unique_ptr`< T1, D1 > &` `const `unique_ptr`< T2, D2 > &`

Returns: x.get() < y.get().

Remarks: This comparison shall induce a strict weak ordering betwen pointers.

bool `const `unique_ptr`< T1, D1 > &` `const `unique_ptr`< T2, D2 > &`

Returns: !(y < x).

bool `const `unique_ptr`< T1, D1 > &` `const `unique_ptr`< T2, D2 > &`

Returns: y < x.

bool `const `unique_ptr`< T1, D1 > &` `const `unique_ptr`< T2, D2 > &`

Returns:!(x < y).

bool `const `unique_ptr`< T, D > &` `std::nullptr_t`

Returns:!x.

bool `std::nullptr_t` `const `unique_ptr`< T, D > &`

Returns:!x.

bool `const `unique_ptr`< T, D > &` `std::nullptr_t`

Returns: (bool)x.

bool `std::nullptr_t` `const `unique_ptr`< T, D > &`

Returns: (bool)x.

bool `const `unique_ptr`< T, D > &` `std::nullptr_t`

Requires: `operator` shall induce a strict weak ordering on unique_ptr<T, D>::pointer values.

Returns: Returns `x.get() < pointer()`.

bool `std::nullptr_t` `const `unique_ptr`< T, D > &`

Requires: `operator` shall induce a strict weak ordering on unique_ptr<T, D>::pointer values.

Returns: Returns `pointer() < x.get()`.

bool `const `unique_ptr`< T, D > &` `std::nullptr_t`

Returns: `nullptr < x`.

bool `std::nullptr_t` `const `unique_ptr`< T, D > &`

Returns: `x < nullptr`.

bool `const `unique_ptr`< T, D > &` `std::nullptr_t`

Returns: `!(nullptr < x)`.

bool `std::nullptr_t` `const `unique_ptr`< T, D > &`

Returns: `!(x < nullptr)`.

bool `const `unique_ptr`< T, D > &` `std::nullptr_t`

Returns: `!(x < nullptr)`.

bool `std::nullptr_t` `const `unique_ptr`< T, D > &`

Returns: `!(nullptr < x)`.

This header includes core utilities from `<boost/move/utility_core.hpp>` and defines some more advanced utilities such as:

rvalue_reference_or_const_lvalue_reference `input_reference`

This function provides a way to convert a reference into a rvalue reference in compilers with rvalue references. For other compilers converts T & into ::boost::rv<T> & so that move emulation is activated. Reference would be converted to rvalue reference only if input type is nothrow move constructible or if it has no copy constructor. In all other cases const reference would be returned

This header defines core utilities to ease the development of move-aware functions. This header minimizes dependencies from other libraries.

This trait's internal boolean `value` is false in compilers with rvalue references and true in compilers without rvalue references.

A user can specialize this trait for a type T to false to SFINAE out `move` and `forward` so that the user can define a different move emulation for that type in namespace boost (e.g. another Boost library for its types) and avoid any overload ambiguity.

const bool
rvalue_reference `input_reference`

This function provides a way to convert a reference into a rvalue reference in compilers with rvalue references. For other compilers if `T` is Boost.Move enabled type then it converts `T&` into `::boost::rv<T> &` so that move emulation is activated, else it returns `T &`.

output_reference `input_reference`

This function provides limited form of forwarding that is usually enough for in-place construction and avoids the exponential overloading for achieve the limited forwarding in C++03.

For compilers with rvalue references this function provides perfect forwarding.

Otherwise:

- If input_reference binds to const ::boost::rv<T> & then it output_reference is ::boost::rv<T> &

- Else, output_reference is equal to input_reference.

output_reference `input_reference`

Effects: Calls `boost::move` if `input_reference` is not a lvalue reference. Otherwise returns the reference