Ticket #7598: unique_ptr.2.patch

File unique_ptr.2.patch, 1.5 KB (added by Ion Gaztañaga, 10 years ago)

Patch to fix the ambiguity

  • boost/interprocess/smart_ptr/unique_ptr.hpp

    old new  
    8282class unique_ptr
    8383{
    8484   /// @cond
    85    struct nat  {int for_bool;};
    86    struct nat2 {int for_bool;};
    87    typedef int nat2::*nullptr_t;
     85   struct nat {int for_bool_;};
    8886   typedef typename ipcdetail::add_reference<D>::type deleter_reference;
    8987   typedef typename ipcdetail::add_reference<const D>::type deleter_const_reference;
    9088   /// @endcond
     
    177175   //!
    178176   //!Throws: nothing.
    179177   template <class U, class E>
    180    unique_ptr(BOOST_RV_REF_BEG unique_ptr<U, E> BOOST_RV_REF_END u,
     178   unique_ptr(BOOST_RV_REF_2_TEMPL_ARGS(unique_ptr, U, E) u,
    181179      typename ipcdetail::enable_if_c<
    182180            ipcdetail::is_convertible<typename unique_ptr<U, E>::pointer, pointer>::value &&
    183181            ipcdetail::is_convertible<E, D>::value &&
     
    232230   //!
    233231   //!Throws: nothing.
    234232   template <class U, class E>
    235    unique_ptr& operator=(BOOST_RV_REF_BEG unique_ptr<U, E> BOOST_RV_REF_END u)
     233   unique_ptr& operator=(BOOST_RV_REF_2_TEMPL_ARGS(unique_ptr, U, E) u)
    236234   {
    237235      reset(u.release());
    238236      ptr_.second() = boost::move(u.get_deleter());
     
    248246   //!Returns: *this.
    249247   //!
    250248   //!Throws: nothing.
    251    unique_ptr& operator=(nullptr_t)
     249   unique_ptr& operator=(int nat::*)
    252250   {
    253251      reset();
    254252      return *this;