Re: [Boost-bugs] [Boost C++ Libraries] #10798: boost::movelib::unique_ptr resolves typedef pointer with the deletor's

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #10798: boost::movelib::unique_ptr resolves typedef pointer with the deletor's
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-12-15 16:30:53


#10798: boost::movelib::unique_ptr resolves typedef pointer with the deletor's
-------------------------------------------------+-------------------------
  Reporter: Matteo Settenvini | Owner: igaztanaga
  <matteo.settenvini@…> | Status: closed
      Type: Bugs | Component: move
 Milestone: To Be Determined | Severity: Problem
   Version: Boost 1.57.0 | Keywords:
Resolution: wontfix |
-------------------------------------------------+-------------------------
Changes (by igaztanaga):

 * status: new => closed
 * resolution: => wontfix

Comment:

 The reason is that the standard mandates that:

 en.cppreference.com/w/cpp/memory/unique_ptr

 {{{
 pointer std::remove_reference<Deleter>::type::pointer if that type
 exists, otherwise T*
 }}}

 boost::movelib::unique_ptr is an implementation of the standard unique_ptr
 for boost. The Interprocess implementation had definitely a bug because it
 was also trying to implement the standard.

 I think you can workaround it with a new deleter that inherits from your
 polymorphic deleter that just forwards it. Something like (simplified
 example):

 {{{

 template<class Derived>
 struct new_deleter
   : public old_deleter
 {
   typedef my_pointer<Derived> pointer;
   void operator()(pointer p)
   { old_deleter::operator()(p); } //Call polymorphic deleter
 };

 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/10798#comment:3>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:17 UTC