123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871 |
- #ifndef BOOST_MOVE_UNIQUE_PTR_HPP_INCLUDED
- #define BOOST_MOVE_UNIQUE_PTR_HPP_INCLUDED
- #ifndef BOOST_CONFIG_HPP
- # include <boost/config.hpp>
- #endif
- #
- #if defined(BOOST_HAS_PRAGMA_ONCE)
- # pragma once
- #endif
- #include <boost/move/detail/config_begin.hpp>
- #include <boost/move/detail/workaround.hpp> //forceinline
- #include <boost/move/detail/unique_ptr_meta_utils.hpp>
- #include <boost/move/default_delete.hpp>
- #include <boost/move/utility_core.hpp>
- #include <boost/move/adl_move_swap.hpp>
- #include <boost/static_assert.hpp>
- #include <boost/assert.hpp>
- #include <cstddef> //For std::nullptr_t and std::size_t
- namespace boost{
- namespace move_upd {
- #if defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
- template <class T>
- class is_noncopyable
- {
- typedef char true_t;
- class false_t { char dummy[2]; };
- template<class U> static false_t dispatch(...);
- template<class U> static true_t dispatch(typename U::boost_move_no_copy_constructor_or_assign*);
- public:
- static const bool value = sizeof(dispatch<T>(0)) == sizeof(true_t);
- };
- #endif
- template <class D>
- struct deleter_types
- {
- typedef typename bmupmu::add_lvalue_reference<D>::type del_ref;
- typedef typename bmupmu::add_const_lvalue_reference<D>::type del_cref;
- #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
- typedef typename bmupmu::if_c
- < bmupmu::is_lvalue_reference<D>::value, D, del_cref >::type deleter_arg_type1;
- typedef typename bmupmu::remove_reference<D>::type && deleter_arg_type2;
- #else
- typedef typename bmupmu::if_c
- < is_noncopyable<D>::value, bmupmu::nat, del_cref>::type non_ref_deleter_arg1;
- typedef typename bmupmu::if_c< bmupmu::is_lvalue_reference<D>::value
- , D, non_ref_deleter_arg1 >::type deleter_arg_type1;
- typedef ::boost::rv<D> & deleter_arg_type2;
- #endif
- };
- template <class P, class D, bool = bmupmu::is_unary_function<D>::value || bmupmu::is_reference<D>::value >
- struct unique_ptr_data
- {
- typedef typename deleter_types<D>::deleter_arg_type1 deleter_arg_type1;
- typedef typename deleter_types<D>::del_ref del_ref;
- typedef typename deleter_types<D>::del_cref del_cref;
- BOOST_MOVE_FORCEINLINE unique_ptr_data() BOOST_NOEXCEPT
- : m_p(), d()
- {}
- BOOST_MOVE_FORCEINLINE explicit unique_ptr_data(P p) BOOST_NOEXCEPT
- : m_p(p), d()
- {}
- BOOST_MOVE_FORCEINLINE unique_ptr_data(P p, deleter_arg_type1 d1) BOOST_NOEXCEPT
- : m_p(p), d(d1)
- {}
- template <class U>
- BOOST_MOVE_FORCEINLINE unique_ptr_data(P p, BOOST_FWD_REF(U) d1) BOOST_NOEXCEPT
- : m_p(p), d(::boost::forward<U>(d1))
- {}
- BOOST_MOVE_FORCEINLINE del_ref deleter() { return d; }
- BOOST_MOVE_FORCEINLINE del_cref deleter() const{ return d; }
- P m_p;
- D d;
- private:
- unique_ptr_data& operator=(const unique_ptr_data&);
- unique_ptr_data(const unique_ptr_data&);
- };
- template <class P, class D>
- struct unique_ptr_data<P, D, false>
- : private D
- {
- typedef typename deleter_types<D>::deleter_arg_type1 deleter_arg_type1;
- typedef typename deleter_types<D>::del_ref del_ref;
- typedef typename deleter_types<D>::del_cref del_cref;
- BOOST_MOVE_FORCEINLINE unique_ptr_data() BOOST_NOEXCEPT
- : D(), m_p()
- {}
- BOOST_MOVE_FORCEINLINE explicit unique_ptr_data(P p) BOOST_NOEXCEPT
- : D(), m_p(p)
- {}
- BOOST_MOVE_FORCEINLINE unique_ptr_data(P p, deleter_arg_type1 d1) BOOST_NOEXCEPT
- : D(d1), m_p(p)
- {}
- template <class U>
- BOOST_MOVE_FORCEINLINE unique_ptr_data(P p, BOOST_FWD_REF(U) d) BOOST_NOEXCEPT
- : D(::boost::forward<U>(d)), m_p(p)
- {}
- BOOST_MOVE_FORCEINLINE del_ref deleter() BOOST_NOEXCEPT { return static_cast<del_ref>(*this); }
- BOOST_MOVE_FORCEINLINE del_cref deleter() const BOOST_NOEXCEPT { return static_cast<del_cref>(*this); }
- P m_p;
- private:
- unique_ptr_data& operator=(const unique_ptr_data&);
- unique_ptr_data(const unique_ptr_data&);
- };
- template <typename T>
- struct get_element_type
- {
- struct DefaultWrap { typedef bmupmu::natify<T> element_type; };
- template <typename X> static char test(int, typename X::element_type*);
- template <typename X> static int test(...);
- static const bool value = (1 == sizeof(test<T>(0, 0)));
- typedef typename bmupmu::if_c<value, T, DefaultWrap>::type::element_type type;
- };
- template<class T>
- struct get_element_type<T*>
- {
- typedef T type;
- };
- template<class T>
- struct get_cvelement
- : bmupmu::remove_cv<typename get_element_type<T>::type>
- {};
- template <class P1, class P2>
- struct is_same_cvelement_and_convertible
- {
- typedef typename bmupmu::remove_reference<P1>::type arg1;
- typedef typename bmupmu::remove_reference<P2>::type arg2;
- static const bool same_cvless =
- bmupmu::is_same<typename get_cvelement<arg1>::type,typename get_cvelement<arg2>::type>::value;
- static const bool value = same_cvless && bmupmu::is_convertible<arg1, arg2>::value;
- };
- template<bool IsArray, class FromPointer, class ThisPointer>
- struct is_unique_ptr_convertible
- : is_same_cvelement_and_convertible<FromPointer, ThisPointer>
- {};
- template<class FromPointer, class ThisPointer>
- struct is_unique_ptr_convertible<false, FromPointer, ThisPointer>
- : bmupmu::is_convertible<FromPointer, ThisPointer>
- {};
- template<class T, class FromPointer, class ThisPointer, class Type = bmupmu::nat>
- struct enable_up_ptr
- : bmupmu::enable_if_c< is_unique_ptr_convertible
- < bmupmu::is_array<T>::value, FromPointer, ThisPointer>::value, Type>
- {};
- template<class T, class D, class U, class E>
- struct unique_moveconvert_assignable
- {
- static const bool t_is_array = bmupmu::is_array<T>::value;
- static const bool value =
- t_is_array == bmupmu::is_array<U>::value &&
- bmupmu::extent<T>::value == bmupmu::extent<U>::value &&
- is_unique_ptr_convertible
- < t_is_array
- , typename bmupmu::pointer_type<U, E>::type, typename bmupmu::pointer_type<T, D>::type
- >::value;
- };
- template<class T, class D, class U, class E, std::size_t N>
- struct unique_moveconvert_assignable<T[], D, U[N], E>
- : unique_moveconvert_assignable<T[], D, U[], E>
- {};
- template<class T, class D, class U, class E, class Type = bmupmu::nat>
- struct enable_up_moveconv_assign
- : bmupmu::enable_if_c<unique_moveconvert_assignable<T, D, U, E>::value, Type>
- {};
- template<class D, class E, bool IsReference = bmupmu::is_reference<D>::value>
- struct unique_deleter_is_initializable
- : bmupmu::is_same<D, E>
- {};
- template <class T, class U>
- class is_rvalue_convertible
- {
- #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
- typedef typename bmupmu::remove_reference<T>::type&& t_from;
- #else
- typedef typename bmupmu::if_c
- < ::boost::has_move_emulation_enabled<T>::value && !bmupmu::is_reference<T>::value
- , ::boost::rv<T>&
- , typename bmupmu::add_lvalue_reference<T>::type
- >::type t_from;
- #endif
- typedef char true_t;
- class false_t { char dummy[2]; };
- static false_t dispatch(...);
- static true_t dispatch(U);
- static t_from trigger();
- public:
- static const bool value = sizeof(dispatch(trigger())) == sizeof(true_t);
- };
- template<class D, class E>
- struct unique_deleter_is_initializable<D, E, false>
- {
- #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
-
-
- #if defined(BOOST_CLANG)
- #if __has_feature(is_convertible_to)
- static const bool value = __is_convertible_to(E, D);
- #else
- static const bool value = is_rvalue_convertible<E, D>::value;
- #endif
- #else
- static const bool value = is_rvalue_convertible<E, D>::value;
- #endif
- #else
-
-
- static const bool value = true;
- #endif
- };
- template<class T, class D, class U, class E, class Type = bmupmu::nat>
- struct enable_up_moveconv_constr
- : bmupmu::enable_if_c
- < unique_moveconvert_assignable<T, D, U, E>::value && unique_deleter_is_initializable<D, E>::value
- , Type>
- {};
- }
- namespace movelib {
- template <class T, class D = default_delete<T> >
- class unique_ptr
- {
- #if defined(BOOST_MOVE_DOXYGEN_INVOKED)
- public:
- unique_ptr(const unique_ptr&) = delete;
- unique_ptr& operator=(const unique_ptr&) = delete;
- private:
- #else
- BOOST_MOVABLE_BUT_NOT_COPYABLE(unique_ptr)
- typedef bmupmu::pointer_type<T, D > pointer_type_obtainer;
- typedef bmupd::unique_ptr_data
- <typename pointer_type_obtainer::type, D> data_type;
- typedef typename bmupd::deleter_types<D>::deleter_arg_type1 deleter_arg_type1;
- typedef typename bmupd::deleter_types<D>::deleter_arg_type2 deleter_arg_type2;
- data_type m_data;
- #endif
- public:
-
-
-
- typedef typename BOOST_MOVE_SEEDOC(pointer_type_obtainer::type) pointer;
-
-
- typedef typename BOOST_MOVE_SEEDOC(bmupmu::remove_extent<T>::type) element_type;
- typedef D deleter_type;
-
-
-
-
-
-
-
-
-
-
- BOOST_MOVE_FORCEINLINE BOOST_CONSTEXPR unique_ptr() BOOST_NOEXCEPT
- : m_data()
- {
-
-
- BOOST_STATIC_ASSERT(!bmupmu::is_pointer<D>::value);
- BOOST_STATIC_ASSERT(!bmupmu::is_reference<D>::value);
- }
-
-
- BOOST_MOVE_FORCEINLINE BOOST_CONSTEXPR unique_ptr(BOOST_MOVE_DOC0PTR(bmupd::nullptr_type)) BOOST_NOEXCEPT
- : m_data()
- {
-
-
- BOOST_STATIC_ASSERT(!bmupmu::is_pointer<D>::value);
- BOOST_STATIC_ASSERT(!bmupmu::is_reference<D>::value);
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
- template<class Pointer>
- BOOST_MOVE_FORCEINLINE explicit unique_ptr(Pointer p
- BOOST_MOVE_DOCIGN(BOOST_MOVE_I typename bmupd::enable_up_ptr<T BOOST_MOVE_I Pointer BOOST_MOVE_I pointer>::type* =0)
- ) BOOST_NOEXCEPT
- : m_data(p)
- {
-
-
- BOOST_STATIC_ASSERT(( !::boost::move_upmu::missing_virtual_destructor
- <D, typename bmupd::get_element_type<Pointer>::type>::value ));
-
-
- BOOST_STATIC_ASSERT(!bmupmu::is_pointer<D>::value);
- BOOST_STATIC_ASSERT(!bmupmu::is_reference<D>::value);
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- template<class Pointer>
- BOOST_MOVE_FORCEINLINE unique_ptr(Pointer p, BOOST_MOVE_SEEDOC(deleter_arg_type1) d1
- BOOST_MOVE_DOCIGN(BOOST_MOVE_I typename bmupd::enable_up_ptr<T BOOST_MOVE_I Pointer BOOST_MOVE_I pointer>::type* =0)
- ) BOOST_NOEXCEPT
- : m_data(p, d1)
- {
-
-
- BOOST_STATIC_ASSERT(( !::boost::move_upmu::missing_virtual_destructor
- <D, typename bmupd::get_element_type<Pointer>::type>::value ));
- }
-
-
- BOOST_MOVE_FORCEINLINE unique_ptr(BOOST_MOVE_DOC0PTR(bmupd::nullptr_type), BOOST_MOVE_SEEDOC(deleter_arg_type1) d1) BOOST_NOEXCEPT
- : m_data(pointer(), d1)
- {}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- template<class Pointer>
- BOOST_MOVE_FORCEINLINE unique_ptr(Pointer p, BOOST_MOVE_SEEDOC(deleter_arg_type2) d2
- BOOST_MOVE_DOCIGN(BOOST_MOVE_I typename bmupd::enable_up_ptr<T BOOST_MOVE_I Pointer BOOST_MOVE_I pointer>::type* =0)
- ) BOOST_NOEXCEPT
- : m_data(p, ::boost::move(d2))
- {
-
-
- BOOST_STATIC_ASSERT(( !::boost::move_upmu::missing_virtual_destructor
- <D, typename bmupd::get_element_type<Pointer>::type>::value ));
- }
-
-
- BOOST_MOVE_FORCEINLINE unique_ptr(BOOST_MOVE_DOC0PTR(bmupd::nullptr_type), BOOST_MOVE_SEEDOC(deleter_arg_type2) d2) BOOST_NOEXCEPT
- : m_data(pointer(), ::boost::move(d2))
- {}
-
-
-
-
-
-
-
-
-
-
- BOOST_MOVE_FORCEINLINE unique_ptr(BOOST_RV_REF(unique_ptr) u) BOOST_NOEXCEPT
- : m_data(u.release(), ::boost::move_if_not_lvalue_reference<D>(u.get_deleter()))
- {}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- template <class U, class E>
- BOOST_MOVE_FORCEINLINE unique_ptr( BOOST_RV_REF_BEG_IF_CXX11 unique_ptr<U, E> BOOST_RV_REF_END_IF_CXX11 u
- BOOST_MOVE_DOCIGN(BOOST_MOVE_I typename bmupd::enable_up_moveconv_constr<T BOOST_MOVE_I D BOOST_MOVE_I U BOOST_MOVE_I E>::type* =0)
- ) BOOST_NOEXCEPT
- : m_data(u.release(), ::boost::move_if_not_lvalue_reference<E>(u.get_deleter()))
- {
-
-
- BOOST_STATIC_ASSERT(( !::boost::move_upmu::missing_virtual_destructor
- <D, typename unique_ptr<U, E>::pointer>::value ));
- }
-
-
-
-
-
-
- ~unique_ptr()
- { if(m_data.m_p) m_data.deleter()(m_data.m_p); }
-
-
-
-
-
-
-
-
-
- unique_ptr& operator=(BOOST_RV_REF(unique_ptr) u) BOOST_NOEXCEPT
- {
- this->reset(u.release());
- m_data.deleter() = ::boost::move_if_not_lvalue_reference<D>(u.get_deleter());
- return *this;
- }
-
-
-
-
-
-
-
-
-
-
-
-
- template <class U, class E>
- BOOST_MOVE_DOC1ST(unique_ptr&, typename bmupd::enable_up_moveconv_assign
- <T BOOST_MOVE_I D BOOST_MOVE_I U BOOST_MOVE_I E BOOST_MOVE_I unique_ptr &>::type)
- operator=(BOOST_RV_REF_BEG unique_ptr<U, E> BOOST_RV_REF_END u) BOOST_NOEXCEPT
- {
- this->reset(u.release());
- m_data.deleter() = ::boost::move_if_not_lvalue_reference<E>(u.get_deleter());
- return *this;
- }
-
-
-
-
-
- unique_ptr& operator=(BOOST_MOVE_DOC0PTR(bmupd::nullptr_type)) BOOST_NOEXCEPT
- { this->reset(); return *this; }
-
-
-
-
-
- BOOST_MOVE_DOC1ST(element_type&, typename bmupmu::add_lvalue_reference<element_type>::type)
- operator*() const BOOST_NOEXCEPT
- {
- BOOST_STATIC_ASSERT((!bmupmu::is_array<T>::value));
- return *m_data.m_p;
- }
-
-
-
-
-
- BOOST_MOVE_FORCEINLINE BOOST_MOVE_DOC1ST(element_type&, typename bmupmu::add_lvalue_reference<element_type>::type)
- operator[](std::size_t i) const BOOST_NOEXCEPT
- {
- BOOST_ASSERT( bmupmu::extent<T>::value == 0 || i < bmupmu::extent<T>::value );
- BOOST_ASSERT(m_data.m_p);
- return m_data.m_p[i];
- }
-
-
-
-
-
-
-
- BOOST_MOVE_FORCEINLINE pointer operator->() const BOOST_NOEXCEPT
- {
- BOOST_STATIC_ASSERT((!bmupmu::is_array<T>::value));
- BOOST_ASSERT(m_data.m_p);
- return m_data.m_p;
- }
-
-
- BOOST_MOVE_FORCEINLINE pointer get() const BOOST_NOEXCEPT
- { return m_data.m_p; }
-
-
- BOOST_MOVE_FORCEINLINE BOOST_MOVE_DOC1ST(D&, typename bmupmu::add_lvalue_reference<D>::type)
- get_deleter() BOOST_NOEXCEPT
- { return m_data.deleter(); }
-
-
- BOOST_MOVE_FORCEINLINE BOOST_MOVE_DOC1ST(const D&, typename bmupmu::add_const_lvalue_reference<D>::type)
- get_deleter() const BOOST_NOEXCEPT
- { return m_data.deleter(); }
- #ifdef BOOST_MOVE_DOXYGEN_INVOKED
-
-
- BOOST_MOVE_FORCEINLINE explicit operator bool
- #else
- BOOST_MOVE_FORCEINLINE operator bmupd::explicit_bool_arg
- #endif
- ()const BOOST_NOEXCEPT
- {
- return m_data.m_p
- ? &bmupd::bool_conversion::for_bool
- : bmupd::explicit_bool_arg(0);
- }
-
-
-
- BOOST_MOVE_FORCEINLINE pointer release() BOOST_NOEXCEPT
- {
- const pointer tmp = m_data.m_p;
- m_data.m_p = pointer();
- return tmp;
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
- template<class Pointer>
- BOOST_MOVE_DOC1ST(void, typename bmupd::enable_up_ptr<T BOOST_MOVE_I Pointer BOOST_MOVE_I pointer BOOST_MOVE_I void>::type)
- reset(Pointer p) BOOST_NOEXCEPT
- {
-
-
- BOOST_STATIC_ASSERT(( !::boost::move_upmu::missing_virtual_destructor
- <D, typename bmupd::get_element_type<Pointer>::type>::value ));
- pointer tmp = m_data.m_p;
- m_data.m_p = p;
- if(tmp) m_data.deleter()(tmp);
- }
-
-
-
-
-
-
-
-
-
- void reset() BOOST_NOEXCEPT
- { this->reset(pointer()); }
-
-
- void reset(BOOST_MOVE_DOC0PTR(bmupd::nullptr_type)) BOOST_NOEXCEPT
- { this->reset(); }
-
-
-
- void swap(unique_ptr& u) BOOST_NOEXCEPT
- {
- ::boost::adl_move_swap(m_data.m_p, u.m_data.m_p);
- ::boost::adl_move_swap(m_data.deleter(), u.m_data.deleter());
- }
- };
- template <class T, class D>
- BOOST_MOVE_FORCEINLINE void swap(unique_ptr<T, D> &x, unique_ptr<T, D> &y) BOOST_NOEXCEPT
- { x.swap(y); }
- template <class T1, class D1, class T2, class D2>
- BOOST_MOVE_FORCEINLINE bool operator==(const unique_ptr<T1, D1> &x, const unique_ptr<T2, D2> &y)
- { return x.get() == y.get(); }
- template <class T1, class D1, class T2, class D2>
- BOOST_MOVE_FORCEINLINE bool operator!=(const unique_ptr<T1, D1> &x, const unique_ptr<T2, D2> &y)
- { return x.get() != y.get(); }
- template <class T1, class D1, class T2, class D2>
- BOOST_MOVE_FORCEINLINE bool operator<(const unique_ptr<T1, D1> &x, const unique_ptr<T2, D2> &y)
- { return x.get() < y.get(); }
- template <class T1, class D1, class T2, class D2>
- BOOST_MOVE_FORCEINLINE bool operator<=(const unique_ptr<T1, D1> &x, const unique_ptr<T2, D2> &y)
- { return !(y < x); }
- template <class T1, class D1, class T2, class D2>
- BOOST_MOVE_FORCEINLINE bool operator>(const unique_ptr<T1, D1> &x, const unique_ptr<T2, D2> &y)
- { return y < x; }
- template <class T1, class D1, class T2, class D2>
- BOOST_MOVE_FORCEINLINE bool operator>=(const unique_ptr<T1, D1> &x, const unique_ptr<T2, D2> &y)
- { return !(x < y); }
- template <class T, class D>
- BOOST_MOVE_FORCEINLINE bool operator==(const unique_ptr<T, D> &x, BOOST_MOVE_DOC0PTR(bmupd::nullptr_type)) BOOST_NOEXCEPT
- { return !x; }
- template <class T, class D>
- BOOST_MOVE_FORCEINLINE bool operator==(BOOST_MOVE_DOC0PTR(bmupd::nullptr_type), const unique_ptr<T, D> &x) BOOST_NOEXCEPT
- { return !x; }
- template <class T, class D>
- BOOST_MOVE_FORCEINLINE bool operator!=(const unique_ptr<T, D> &x, BOOST_MOVE_DOC0PTR(bmupd::nullptr_type)) BOOST_NOEXCEPT
- { return !!x; }
- template <class T, class D>
- BOOST_MOVE_FORCEINLINE bool operator!=(BOOST_MOVE_DOC0PTR(bmupd::nullptr_type), const unique_ptr<T, D> &x) BOOST_NOEXCEPT
- { return !!x; }
- template <class T, class D>
- BOOST_MOVE_FORCEINLINE bool operator<(const unique_ptr<T, D> &x, BOOST_MOVE_DOC0PTR(bmupd::nullptr_type))
- { return x.get() < typename unique_ptr<T, D>::pointer(); }
- template <class T, class D>
- BOOST_MOVE_FORCEINLINE bool operator<(BOOST_MOVE_DOC0PTR(bmupd::nullptr_type), const unique_ptr<T, D> &x)
- { return typename unique_ptr<T, D>::pointer() < x.get(); }
- template <class T, class D>
- BOOST_MOVE_FORCEINLINE bool operator>(const unique_ptr<T, D> &x, BOOST_MOVE_DOC0PTR(bmupd::nullptr_type))
- { return x.get() > typename unique_ptr<T, D>::pointer(); }
- template <class T, class D>
- BOOST_MOVE_FORCEINLINE bool operator>(BOOST_MOVE_DOC0PTR(bmupd::nullptr_type), const unique_ptr<T, D> &x)
- { return typename unique_ptr<T, D>::pointer() > x.get(); }
- template <class T, class D>
- BOOST_MOVE_FORCEINLINE bool operator<=(const unique_ptr<T, D> &x, BOOST_MOVE_DOC0PTR(bmupd::nullptr_type))
- { return !(bmupd::nullptr_type() < x); }
- template <class T, class D>
- BOOST_MOVE_FORCEINLINE bool operator<=(BOOST_MOVE_DOC0PTR(bmupd::nullptr_type), const unique_ptr<T, D> &x)
- { return !(x < bmupd::nullptr_type()); }
- template <class T, class D>
- BOOST_MOVE_FORCEINLINE bool operator>=(const unique_ptr<T, D> &x, BOOST_MOVE_DOC0PTR(bmupd::nullptr_type))
- { return !(x < bmupd::nullptr_type()); }
- template <class T, class D>
- BOOST_MOVE_FORCEINLINE bool operator>=(BOOST_MOVE_DOC0PTR(bmupd::nullptr_type), const unique_ptr<T, D> &x)
- { return !(bmupd::nullptr_type() < x); }
- }
- }
- #include <boost/move/detail/config_end.hpp>
- #endif
|