File indexing completed on 2026-09-17 08:54:27
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef BOOST_MOVE_UNIQUE_PTR_HPP_INCLUDED
0012 #define BOOST_MOVE_UNIQUE_PTR_HPP_INCLUDED
0013
0014 #ifndef BOOST_CONFIG_HPP
0015 # include <boost/config.hpp>
0016 #endif
0017 0018 ">#
0019 #if defined(BOOST_HAS_PRAGMA_ONCE)
0020 # pragma once
0021 #endif
0022
0023 #include <boost/move/detail/config_begin.hpp>
0024 #include <boost/move/detail/workaround.hpp> //forceinline
0025 #include <boost/move/detail/unique_ptr_meta_utils.hpp>
0026 #include <boost/move/default_delete.hpp>
0027 #include <boost/move/utility_core.hpp>
0028 #include <boost/move/adl_move_swap.hpp>
0029 #include <cassert>
0030
0031 #include <cstddef> //For std::nullptr_t and std::size_t
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048 namespace boost{
0049
0050 namespace move_upd {
0051
0052
0053
0054
0055 #if defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
0056 template <class T>
0057 class is_noncopyable
0058 {
0059 typedef char true_t;
0060 class false_t { char dummy[2]; };
0061 template<class U> static false_t dispatch(...);
0062 template<class U> static true_t dispatch(typename U::boost_move_no_copy_constructor_or_assign*);
0063 public:
0064 static const bool value = sizeof(dispatch<T>(0)) == sizeof(true_t);
0065 };
0066 #endif
0067
0068 template <class D>
0069 struct deleter_types
0070 {
0071 typedef typename bmupmu::add_lvalue_reference<D>::type del_ref;
0072 typedef typename bmupmu::add_const_lvalue_reference<D>::type del_cref;
0073 #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
0074 typedef typename bmupmu::if_c
0075 < bmupmu::is_lvalue_reference<D>::value, D, del_cref >::type deleter_arg_type1;
0076 typedef typename bmupmu::remove_reference<D>::type && deleter_arg_type2;
0077 #else
0078 typedef typename bmupmu::if_c
0079 < is_noncopyable<D>::value, bmupmu::nat, del_cref>::type non_ref_deleter_arg1;
0080 typedef typename bmupmu::if_c< bmupmu::is_lvalue_reference<D>::value
0081 , D, non_ref_deleter_arg1 >::type deleter_arg_type1;
0082 typedef ::boost::rv<D> & deleter_arg_type2;
0083 #endif
0084 };
0085
0086
0087
0088
0089 template <class P, class D, bool = bmupmu::is_unary_function<D>::value || bmupmu::is_reference<D>::value >
0090 struct unique_ptr_data
0091 {
0092 typedef typename deleter_types<D>::deleter_arg_type1 deleter_arg_type1;
0093 typedef typename deleter_types<D>::del_ref del_ref;
0094 typedef typename deleter_types<D>::del_cref del_cref;
0095
0096 inline unique_ptr_data() BOOST_NOEXCEPT
0097 : m_p(), d()
0098 {}
0099
0100 inline explicit unique_ptr_data(P p) BOOST_NOEXCEPT
0101 : m_p(p), d()
0102 {}
0103
0104 inline unique_ptr_data(P p, deleter_arg_type1 d1) BOOST_NOEXCEPT
0105 : m_p(p), d(d1)
0106 {}
0107
0108 template <class U>
0109 inline unique_ptr_data(P p, BOOST_FWD_REF(U) d1) BOOST_NOEXCEPT
0110 : m_p(p), d(::boost::forward<U>(d1))
0111 {}
0112
0113 inline del_ref deleter() { return d; }
0114 inline del_cref deleter() const{ return d; }
0115
0116 P m_p;
0117 D d;
0118
0119 private:
0120 unique_ptr_data& operator=(const unique_ptr_data&);
0121 unique_ptr_data(const unique_ptr_data&);
0122 };
0123
0124 template <class P, class D>
0125 struct unique_ptr_data<P, D, false>
0126 : private D
0127 {
0128 typedef typename deleter_types<D>::deleter_arg_type1 deleter_arg_type1;
0129 typedef typename deleter_types<D>::del_ref del_ref;
0130 typedef typename deleter_types<D>::del_cref del_cref;
0131
0132 inline unique_ptr_data() BOOST_NOEXCEPT
0133 : D(), m_p()
0134 {}
0135
0136 inline explicit unique_ptr_data(P p) BOOST_NOEXCEPT
0137 : D(), m_p(p)
0138 {}
0139
0140 inline unique_ptr_data(P p, deleter_arg_type1 d1) BOOST_NOEXCEPT
0141 : D(d1), m_p(p)
0142 {}
0143
0144 template <class U>
0145 inline unique_ptr_data(P p, BOOST_FWD_REF(U) d) BOOST_NOEXCEPT
0146 : D(::boost::forward<U>(d)), m_p(p)
0147 {}
0148
0149 inline del_ref deleter() BOOST_NOEXCEPT { return static_cast<del_ref>(*this); }
0150 inline del_cref deleter() const BOOST_NOEXCEPT { return static_cast<del_cref>(*this); }
0151
0152 P m_p;
0153
0154 private:
0155 unique_ptr_data& operator=(const unique_ptr_data&);
0156 unique_ptr_data(const unique_ptr_data&);
0157 };
0158
0159
0160
0161
0162
0163
0164
0165 template <typename T>
0166 struct get_element_type
0167 {
0168 struct DefaultWrap { typedef bmupmu::natify<T> element_type; };
0169 template <typename X> static char test(int, typename X::element_type*);
0170 template <typename X> static int test(...);
0171 static const bool value = (1 == sizeof(test<T>(0, 0)));
0172 typedef typename bmupmu::if_c<value, T, DefaultWrap>::type::element_type type;
0173 };
0174
0175 template<class T>
0176 struct get_element_type<T*>
0177 {
0178 typedef T type;
0179 };
0180
0181 template<class T>
0182 struct get_cvelement
0183 : bmupmu::remove_cv<typename get_element_type<T>::type>
0184 {};
0185
0186 template <class P1, class P2>
0187 struct is_same_cvelement_and_convertible
0188 {
0189 typedef typename bmupmu::remove_reference<P1>::type arg1;
0190 typedef typename bmupmu::remove_reference<P2>::type arg2;
0191 static const bool same_cvless =
0192 bmupmu::is_same<typename get_cvelement<arg1>::type,typename get_cvelement<arg2>::type>::value;
0193 static const bool value = same_cvless && bmupmu::is_convertible<arg1, arg2>::value;
0194 };
0195
0196 template<bool IsArray, class FromPointer, class ThisPointer>
0197 struct is_unique_ptr_convertible
0198 : is_same_cvelement_and_convertible<FromPointer, ThisPointer>
0199 {};
0200
0201 template<class FromPointer, class ThisPointer>
0202 struct is_unique_ptr_convertible<false, FromPointer, ThisPointer>
0203 : bmupmu::is_convertible<FromPointer, ThisPointer>
0204 {};
0205
0206
0207
0208
0209
0210 template<class T, class FromPointer, class ThisPointer, class Type = bmupmu::nat>
0211 struct enable_up_ptr
0212 : bmupmu::enable_if_c< is_unique_ptr_convertible
0213 < bmupmu::is_array<T>::value, FromPointer, ThisPointer>::value, Type>
0214 {};
0215
0216
0217
0218
0219
0220 template<class T, class D, class U, class E>
0221 struct unique_moveconvert_assignable
0222 {
0223 static const bool t_is_array = bmupmu::is_array<T>::value;
0224 static const bool value =
0225 t_is_array == bmupmu::is_array<U>::value &&
0226 bmupmu::extent<T>::value == bmupmu::extent<U>::value &&
0227 is_unique_ptr_convertible
0228 < t_is_array
0229 , typename bmupmu::pointer_type<U, E>::type, typename bmupmu::pointer_type<T, D>::type
0230 >::value;
0231 };
0232
0233 template<class T, class D, class U, class E, std::size_t N>
0234 struct unique_moveconvert_assignable<T[], D, U[N], E>
0235 : unique_moveconvert_assignable<T[], D, U[], E>
0236 {};
0237
0238 template<class T, class D, class U, class E, class Type = bmupmu::nat>
0239 struct enable_up_moveconv_assign
0240 : bmupmu::enable_if_c<unique_moveconvert_assignable<T, D, U, E>::value, Type>
0241 {};
0242
0243
0244
0245
0246
0247 template<class D, class E, bool IsReference = bmupmu::is_reference<D>::value>
0248 struct unique_deleter_is_initializable
0249 : bmupmu::is_same<D, E>
0250 {};
0251
0252 template <class T, class U>
0253 class is_rvalue_convertible
0254 {
0255 #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
0256 typedef typename bmupmu::remove_reference<T>::type&& t_from;
0257 #else
0258 typedef typename bmupmu::if_c
0259 < ::boost::has_move_emulation_enabled<T>::value && !bmupmu::is_reference<T>::value
0260 , ::boost::rv<T>&
0261 , typename bmupmu::add_lvalue_reference<T>::type
0262 >::type t_from;
0263 #endif
0264
0265 typedef char true_t;
0266 class false_t { char dummy[2]; };
0267 static false_t dispatch(...);
0268 static true_t dispatch(U);
0269 static t_from trigger();
0270 public:
0271 static const bool value = sizeof(dispatch(trigger())) == sizeof(true_t);
0272 };
0273
0274 template<class D, class E>
0275 struct unique_deleter_is_initializable<D, E, false>
0276 {
0277 #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
0278
0279
0280 #if defined(BOOST_CLANG)
0281 #if __has_feature(is_convertible_to)
0282 static const bool value = __is_convertible_to(E, D);
0283 #else
0284 static const bool value = is_rvalue_convertible<E, D>::value;
0285 #endif
0286 #else
0287 static const bool value = is_rvalue_convertible<E, D>::value;
0288 #endif
0289
0290 #else
0291
0292
0293 static const bool value = true;
0294 #endif
0295 };
0296
0297 template<class T, class D, class U, class E, class Type = bmupmu::nat>
0298 struct enable_up_moveconv_constr
0299 : bmupmu::enable_if_c
0300 < unique_moveconvert_assignable<T, D, U, E>::value && unique_deleter_is_initializable<D, E>::value
0301 , Type>
0302 {};
0303
0304 }
0305
0306
0307 namespace movelib {
0308
0309
0310
0311
0312
0313
0314
0315
0316
0317
0318
0319
0320
0321
0322
0323
0324
0325
0326
0327
0328
0329
0330
0331
0332
0333
0334
0335
0336
0337
0338
0339
0340
0341
0342
0343
0344
0345
0346
0347
0348
0349
0350
0351
0352
0353 template <class T, class D = default_delete<T> >
0354 class unique_ptr
0355 {
0356 #if defined(BOOST_MOVE_DOXYGEN_INVOKED)
0357 public:
0358 unique_ptr(const unique_ptr&) = delete;
0359 unique_ptr& operator=(const unique_ptr&) = delete;
0360 private:
0361 #else
0362 BOOST_MOVABLE_BUT_NOT_COPYABLE(unique_ptr)
0363
0364 typedef bmupmu::pointer_type<T, D > pointer_type_obtainer;
0365 typedef bmupd::unique_ptr_data
0366 <typename pointer_type_obtainer::type, D> data_type;
0367 typedef typename bmupd::deleter_types<D>::deleter_arg_type1 deleter_arg_type1;
0368 typedef typename bmupd::deleter_types<D>::deleter_arg_type2 deleter_arg_type2;
0369 data_type m_data;
0370 #endif
0371
0372 public:
0373
0374
0375
0376 typedef typename BOOST_MOVE_SEEDOC(pointer_type_obtainer::type) pointer;
0377
0378
0379 typedef typename BOOST_MOVE_SEEDOC(bmupmu::remove_extent<T>::type) element_type;
0380 typedef D deleter_type;
0381
0382
0383
0384
0385
0386
0387
0388
0389
0390
0391
0392 inline BOOST_CONSTEXPR unique_ptr() BOOST_NOEXCEPT
0393 : m_data()
0394 {
0395
0396
0397 BOOST_MOVE_STATIC_ASSERT(!bmupmu::is_pointer<D>::value);
0398 BOOST_MOVE_STATIC_ASSERT(!bmupmu::is_reference<D>::value);
0399 }
0400
0401
0402
0403 inline BOOST_CONSTEXPR unique_ptr(BOOST_MOVE_DOC0PTR(bmupd::nullptr_type)) BOOST_NOEXCEPT
0404 : m_data()
0405 {
0406
0407
0408 BOOST_MOVE_STATIC_ASSERT(!bmupmu::is_pointer<D>::value);
0409 BOOST_MOVE_STATIC_ASSERT(!bmupmu::is_reference<D>::value);
0410 }
0411
0412
0413
0414
0415
0416
0417
0418
0419
0420
0421
0422
0423
0424
0425 template<class Pointer>
0426 inline explicit unique_ptr(Pointer p
0427 BOOST_MOVE_DOCIGN(BOOST_MOVE_I typename bmupd::enable_up_ptr<T BOOST_MOVE_I Pointer BOOST_MOVE_I pointer>::type* =0)
0428 ) BOOST_NOEXCEPT
0429 : m_data(p)
0430 {
0431
0432
0433 BOOST_MOVE_STATIC_ASSERT(( !bmupd::missing_virtual_destructor
0434 <D, typename bmupd::get_element_type<Pointer>::type>::value ));
0435
0436
0437 BOOST_MOVE_STATIC_ASSERT(!bmupmu::is_pointer<D>::value);
0438 BOOST_MOVE_STATIC_ASSERT(!bmupmu::is_reference<D>::value);
0439 }
0440
0441
0442
0443
0444
0445
0446
0447
0448
0449
0450
0451
0452
0453
0454
0455
0456
0457
0458
0459
0460
0461
0462
0463 template<class Pointer>
0464 inline unique_ptr(Pointer p, BOOST_MOVE_SEEDOC(deleter_arg_type1) d1
0465 BOOST_MOVE_DOCIGN(BOOST_MOVE_I typename bmupd::enable_up_ptr<T BOOST_MOVE_I Pointer BOOST_MOVE_I pointer>::type* =0)
0466 ) BOOST_NOEXCEPT
0467 : m_data(p, d1)
0468 {
0469
0470
0471 BOOST_MOVE_STATIC_ASSERT(( !bmupd::missing_virtual_destructor
0472 <D, typename bmupd::get_element_type<Pointer>::type>::value ));
0473 }
0474
0475
0476
0477 inline unique_ptr(BOOST_MOVE_DOC0PTR(bmupd::nullptr_type), BOOST_MOVE_SEEDOC(deleter_arg_type1) d1) BOOST_NOEXCEPT
0478 : m_data(pointer(), d1)
0479 {}
0480
0481
0482
0483
0484
0485
0486
0487
0488
0489
0490
0491
0492
0493
0494
0495
0496
0497
0498
0499
0500
0501 template<class Pointer>
0502 inline unique_ptr(Pointer p, BOOST_MOVE_SEEDOC(deleter_arg_type2) d2
0503 BOOST_MOVE_DOCIGN(BOOST_MOVE_I typename bmupd::enable_up_ptr<T BOOST_MOVE_I Pointer BOOST_MOVE_I pointer>::type* =0)
0504 ) BOOST_NOEXCEPT
0505 : m_data(p, ::boost::move(d2))
0506 {
0507
0508
0509 BOOST_MOVE_STATIC_ASSERT(( !bmupd::missing_virtual_destructor
0510 <D, typename bmupd::get_element_type<Pointer>::type>::value ));
0511 }
0512
0513
0514
0515 inline unique_ptr(BOOST_MOVE_DOC0PTR(bmupd::nullptr_type), BOOST_MOVE_SEEDOC(deleter_arg_type2) d2) BOOST_NOEXCEPT
0516 : m_data(pointer(), ::boost::move(d2))
0517 {}
0518
0519
0520
0521
0522
0523
0524
0525
0526
0527
0528
0529 inline unique_ptr(BOOST_RV_REF(unique_ptr) u) BOOST_NOEXCEPT
0530 : m_data(u.release(), ::boost::move_if_not_lvalue_reference<D>(u.get_deleter()))
0531 {}
0532
0533
0534
0535
0536
0537
0538
0539
0540
0541
0542
0543
0544
0545
0546
0547
0548 template <class U, class E>
0549 inline unique_ptr( BOOST_RV_REF_BEG_IF_CXX11 unique_ptr<U, E> BOOST_RV_REF_END_IF_CXX11 u
0550 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)
0551 ) BOOST_NOEXCEPT
0552 : m_data(u.release(), ::boost::move_if_not_lvalue_reference<E>(u.get_deleter()))
0553 {
0554
0555
0556 BOOST_MOVE_STATIC_ASSERT(( !bmupd::missing_virtual_destructor
0557 <D, typename unique_ptr<U, E>::pointer>::value ));
0558 }
0559
0560
0561
0562
0563
0564
0565
0566 ~unique_ptr()
0567 { if(m_data.m_p) m_data.deleter()(m_data.m_p); }
0568
0569
0570
0571
0572
0573
0574
0575
0576
0577
0578 unique_ptr& operator=(BOOST_RV_REF(unique_ptr) u) BOOST_NOEXCEPT
0579 {
0580 this->reset(u.release());
0581 m_data.deleter() = ::boost::move_if_not_lvalue_reference<D>(u.get_deleter());
0582 return *this;
0583 }
0584
0585
0586
0587
0588
0589
0590
0591
0592
0593
0594
0595
0596
0597 template <class U, class E>
0598 BOOST_MOVE_DOC1ST(unique_ptr&, typename bmupd::enable_up_moveconv_assign
0599 <T BOOST_MOVE_I D BOOST_MOVE_I U BOOST_MOVE_I E BOOST_MOVE_I unique_ptr &>::type)
0600 operator=(BOOST_RV_REF_BEG unique_ptr<U, E> BOOST_RV_REF_END u) BOOST_NOEXCEPT
0601 {
0602 this->reset(u.release());
0603 m_data.deleter() = ::boost::move_if_not_lvalue_reference<E>(u.get_deleter());
0604 return *this;
0605 }
0606
0607
0608
0609
0610
0611
0612 unique_ptr& operator=(BOOST_MOVE_DOC0PTR(bmupd::nullptr_type)) BOOST_NOEXCEPT
0613 { this->reset(); return *this; }
0614
0615
0616
0617
0618
0619
0620 BOOST_MOVE_DOC1ST(element_type&, typename bmupmu::add_lvalue_reference<element_type>::type)
0621 operator*() const BOOST_NOEXCEPT
0622 {
0623 BOOST_MOVE_STATIC_ASSERT((!bmupmu::is_array<T>::value));
0624 return *m_data.m_p;
0625 }
0626
0627
0628
0629
0630
0631
0632 inline BOOST_MOVE_DOC1ST(element_type&, typename bmupmu::add_lvalue_reference<element_type>::type)
0633 operator[](std::size_t i) const BOOST_NOEXCEPT
0634 {
0635 assert( bmupmu::extent<T>::value == 0 || i < bmupmu::extent<T>::value );
0636 assert(m_data.m_p);
0637 return m_data.m_p[i];
0638 }
0639
0640
0641
0642
0643
0644
0645
0646
0647 inline pointer operator->() const BOOST_NOEXCEPT
0648 {
0649 BOOST_MOVE_STATIC_ASSERT((!bmupmu::is_array<T>::value));
0650 assert(m_data.m_p);
0651 return m_data.m_p;
0652 }
0653
0654
0655
0656 inline pointer get() const BOOST_NOEXCEPT
0657 { return m_data.m_p; }
0658
0659
0660
0661 inline BOOST_MOVE_DOC1ST(D&, typename bmupmu::add_lvalue_reference<D>::type)
0662 get_deleter() BOOST_NOEXCEPT
0663 { return m_data.deleter(); }
0664
0665
0666
0667 inline BOOST_MOVE_DOC1ST(const D&, typename bmupmu::add_const_lvalue_reference<D>::type)
0668 get_deleter() const BOOST_NOEXCEPT
0669 { return m_data.deleter(); }
0670
0671 #ifdef BOOST_MOVE_DOXYGEN_INVOKED
0672
0673
0674 inline explicit operator bool
0675 #else
0676 inline operator bmupd::explicit_bool_arg
0677 #endif
0678 ()const BOOST_NOEXCEPT
0679 {
0680 return m_data.m_p
0681 ? &bmupd::bool_conversion::for_bool
0682 : bmupd::explicit_bool_arg(0);
0683 }
0684
0685
0686
0687
0688 inline pointer release() BOOST_NOEXCEPT
0689 {
0690 const pointer tmp = m_data.m_p;
0691 m_data.m_p = pointer();
0692 return tmp;
0693 }
0694
0695
0696
0697
0698
0699
0700
0701
0702
0703
0704
0705
0706
0707
0708 template<class Pointer>
0709 BOOST_MOVE_DOC1ST(void, typename bmupd::enable_up_ptr<T BOOST_MOVE_I Pointer BOOST_MOVE_I pointer BOOST_MOVE_I void>::type)
0710 reset(Pointer p) BOOST_NOEXCEPT
0711 {
0712
0713
0714 BOOST_MOVE_STATIC_ASSERT(( !bmupd::missing_virtual_destructor
0715 <D, typename bmupd::get_element_type<Pointer>::type>::value ));
0716 pointer tmp = m_data.m_p;
0717 m_data.m_p = p;
0718 if(tmp) m_data.deleter()(tmp);
0719 }
0720
0721
0722
0723
0724
0725
0726
0727
0728
0729
0730 void reset() BOOST_NOEXCEPT
0731 { this->reset(pointer()); }
0732
0733
0734
0735 void reset(BOOST_MOVE_DOC0PTR(bmupd::nullptr_type)) BOOST_NOEXCEPT
0736 { this->reset(); }
0737
0738
0739
0740
0741 void swap(unique_ptr& u) BOOST_NOEXCEPT
0742 {
0743 ::boost::adl_move_swap(m_data.m_p, u.m_data.m_p);
0744 ::boost::adl_move_swap(m_data.deleter(), u.m_data.deleter());
0745 }
0746 };
0747
0748
0749
0750 template <class T, class D>
0751 inline void swap(unique_ptr<T, D> &x, unique_ptr<T, D> &y) BOOST_NOEXCEPT
0752 { x.swap(y); }
0753
0754
0755
0756 template <class T1, class D1, class T2, class D2>
0757 inline bool operator==(const unique_ptr<T1, D1> &x, const unique_ptr<T2, D2> &y)
0758 { return x.get() == y.get(); }
0759
0760
0761
0762 template <class T1, class D1, class T2, class D2>
0763 inline bool operator!=(const unique_ptr<T1, D1> &x, const unique_ptr<T2, D2> &y)
0764 { return x.get() != y.get(); }
0765
0766
0767
0768
0769
0770 template <class T1, class D1, class T2, class D2>
0771 inline bool operator<(const unique_ptr<T1, D1> &x, const unique_ptr<T2, D2> &y)
0772 { return x.get() < y.get(); }
0773
0774
0775
0776 template <class T1, class D1, class T2, class D2>
0777 inline bool operator<=(const unique_ptr<T1, D1> &x, const unique_ptr<T2, D2> &y)
0778 { return !(y < x); }
0779
0780
0781
0782 template <class T1, class D1, class T2, class D2>
0783 inline bool operator>(const unique_ptr<T1, D1> &x, const unique_ptr<T2, D2> &y)
0784 { return y < x; }
0785
0786
0787
0788 template <class T1, class D1, class T2, class D2>
0789 inline bool operator>=(const unique_ptr<T1, D1> &x, const unique_ptr<T2, D2> &y)
0790 { return !(x < y); }
0791
0792
0793
0794 template <class T, class D>
0795 inline bool operator==(const unique_ptr<T, D> &x, BOOST_MOVE_DOC0PTR(bmupd::nullptr_type)) BOOST_NOEXCEPT
0796 { return !x; }
0797
0798
0799
0800 template <class T, class D>
0801 inline bool operator==(BOOST_MOVE_DOC0PTR(bmupd::nullptr_type), const unique_ptr<T, D> &x) BOOST_NOEXCEPT
0802 { return !x; }
0803
0804
0805
0806 template <class T, class D>
0807 inline bool operator!=(const unique_ptr<T, D> &x, BOOST_MOVE_DOC0PTR(bmupd::nullptr_type)) BOOST_NOEXCEPT
0808 { return !!x; }
0809
0810
0811
0812 template <class T, class D>
0813 inline bool operator!=(BOOST_MOVE_DOC0PTR(bmupd::nullptr_type), const unique_ptr<T, D> &x) BOOST_NOEXCEPT
0814 { return !!x; }
0815
0816
0817
0818
0819 template <class T, class D>
0820 inline bool operator<(const unique_ptr<T, D> &x, BOOST_MOVE_DOC0PTR(bmupd::nullptr_type))
0821 { return x.get() < typename unique_ptr<T, D>::pointer(); }
0822
0823
0824
0825
0826 template <class T, class D>
0827 inline bool operator<(BOOST_MOVE_DOC0PTR(bmupd::nullptr_type), const unique_ptr<T, D> &x)
0828 { return typename unique_ptr<T, D>::pointer() < x.get(); }
0829
0830
0831
0832 template <class T, class D>
0833 inline bool operator>(const unique_ptr<T, D> &x, BOOST_MOVE_DOC0PTR(bmupd::nullptr_type))
0834 { return x.get() > typename unique_ptr<T, D>::pointer(); }
0835
0836
0837
0838 template <class T, class D>
0839 inline bool operator>(BOOST_MOVE_DOC0PTR(bmupd::nullptr_type), const unique_ptr<T, D> &x)
0840 { return typename unique_ptr<T, D>::pointer() > x.get(); }
0841
0842
0843
0844 template <class T, class D>
0845 inline bool operator<=(const unique_ptr<T, D> &x, BOOST_MOVE_DOC0PTR(bmupd::nullptr_type))
0846 { return !(bmupd::nullptr_type() < x); }
0847
0848
0849
0850 template <class T, class D>
0851 inline bool operator<=(BOOST_MOVE_DOC0PTR(bmupd::nullptr_type), const unique_ptr<T, D> &x)
0852 { return !(x < bmupd::nullptr_type()); }
0853
0854
0855
0856 template <class T, class D>
0857 inline bool operator>=(const unique_ptr<T, D> &x, BOOST_MOVE_DOC0PTR(bmupd::nullptr_type))
0858 { return !(x < bmupd::nullptr_type()); }
0859
0860
0861
0862 template <class T, class D>
0863 inline bool operator>=(BOOST_MOVE_DOC0PTR(bmupd::nullptr_type), const unique_ptr<T, D> &x)
0864 { return !(bmupd::nullptr_type() < x); }
0865
0866 }
0867 }
0868
0869 #include <boost/move/detail/config_end.hpp>
0870
0871 #endif