Describes the smart pointer unique_ptr, a drop-in replacement for std::unique_ptr, usable also from C++03 compilers. More...
#include <boost/move/detail/config_begin.hpp>
#include <boost/move/detail/workaround.hpp>
#include <boost/move/detail/unique_ptr_meta_utils.hpp>
#include <boost/move/default_delete.hpp>
#include <boost/move/utility_core.hpp>
#include <boost/static_assert.hpp>
#include <boost/assert.hpp>
#include <cstddef>
#include <boost/move/detail/config_end.hpp>
Namespaces | |
boost | |
Duration formatting facet for input. | |
boost::move_upd | |
boost::movelib | |
Functions | |
template<class T , class D > | |
void | boost::movelib::swap (unique_ptr< T, D > &x, unique_ptr< T, D > &y) BOOST_NOEXCEPT |
Effects: Calls x.swap(y) . More... | |
template<class T1 , class D1 , class T2 , class D2 > | |
bool | boost::movelib::operator== (const unique_ptr< T1, D1 > &x, const unique_ptr< T2, D2 > &y) |
Returns: x.get() == y.get() . More... | |
template<class T1 , class D1 , class T2 , class D2 > | |
bool | boost::movelib::operator!= (const unique_ptr< T1, D1 > &x, const unique_ptr< T2, D2 > &y) |
Returns: x.get() != y.get() . More... | |
template<class T1 , class D1 , class T2 , class D2 > | |
bool | boost::movelib::operator< (const unique_ptr< T1, D1 > &x, const unique_ptr< T2, D2 > &y) |
Returns: x.get() < y.get(). More... | |
template<class T1 , class D1 , class T2 , class D2 > | |
bool | boost::movelib::operator<= (const unique_ptr< T1, D1 > &x, const unique_ptr< T2, D2 > &y) |
Returns: !(y < x). More... | |
template<class T1 , class D1 , class T2 , class D2 > | |
bool | boost::movelib::operator> (const unique_ptr< T1, D1 > &x, const unique_ptr< T2, D2 > &y) |
Returns: y < x. More... | |
template<class T1 , class D1 , class T2 , class D2 > | |
bool | boost::movelib::operator>= (const unique_ptr< T1, D1 > &x, const unique_ptr< T2, D2 > &y) |
Returns:!(x < y). More... | |
template<class T , class D > | |
bool | boost::movelib::operator== (const unique_ptr< T, D > &x, BOOST_MOVE_DOC0PTR(bmupd::nullptr_type)) BOOST_NOEXCEPT |
Returns:!x. More... | |
template<class T , class D > | |
bool | boost::movelib::operator== (BOOST_MOVE_DOC0PTR(bmupd::nullptr_type), const unique_ptr< T, D > &x) BOOST_NOEXCEPT |
Returns:!x. More... | |
template<class T , class D > | |
bool | boost::movelib::operator!= (const unique_ptr< T, D > &x, BOOST_MOVE_DOC0PTR(bmupd::nullptr_type)) BOOST_NOEXCEPT |
Returns: (bool)x. More... | |
template<class T , class D > | |
bool | boost::movelib::operator!= (BOOST_MOVE_DOC0PTR(bmupd::nullptr_type), const unique_ptr< T, D > &x) BOOST_NOEXCEPT |
Returns: (bool)x. More... | |
template<class T , class D > | |
bool | boost::movelib::operator< (const unique_ptr< T, D > &x, BOOST_MOVE_DOC0PTR(bmupd::nullptr_type)) |
Requires: operator shall induce a strict weak ordering on unique_ptr<T, D>::pointer values. More... | |
template<class T , class D > | |
bool | boost::movelib::operator< (BOOST_MOVE_DOC0PTR(bmupd::nullptr_type), const unique_ptr< T, D > &x) |
Requires: operator shall induce a strict weak ordering on unique_ptr<T, D>::pointer values. More... | |
template<class T , class D > | |
bool | boost::movelib::operator> (const unique_ptr< T, D > &x, BOOST_MOVE_DOC0PTR(bmupd::nullptr_type)) |
Returns: nullptr < x . More... | |
template<class T , class D > | |
bool | boost::movelib::operator> (BOOST_MOVE_DOC0PTR(bmupd::nullptr_type), const unique_ptr< T, D > &x) |
Returns: x < nullptr . More... | |
template<class T , class D > | |
bool | boost::movelib::operator<= (const unique_ptr< T, D > &x, BOOST_MOVE_DOC0PTR(bmupd::nullptr_type)) |
Returns: !(nullptr < x) . More... | |
template<class T , class D > | |
bool | boost::movelib::operator<= (BOOST_MOVE_DOC0PTR(bmupd::nullptr_type), const unique_ptr< T, D > &x) |
Returns: !(x < nullptr) . More... | |
template<class T , class D > | |
bool | boost::movelib::operator>= (const unique_ptr< T, D > &x, BOOST_MOVE_DOC0PTR(bmupd::nullptr_type)) |
Returns: !(x < nullptr) . More... | |
template<class T , class D > | |
bool | boost::movelib::operator>= (BOOST_MOVE_DOC0PTR(bmupd::nullptr_type), const unique_ptr< T, D > &x) |
Returns: !(nullptr < x) . More... | |
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.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.