[Boost-bugs] [Boost C++ Libraries] #8976: interprocess::shared_ptr fails to compile if used with a scoped_allocator

Subject: [Boost-bugs] [Boost C++ Libraries] #8976: interprocess::shared_ptr fails to compile if used with a scoped_allocator
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-08-08 14:11:20


#8976: interprocess::shared_ptr fails to compile if used with a scoped_allocator
---------------------------------------------+--------------------------
 Reporter: Markus Mathes <Markus.Mathes@…> | Owner: igaztanaga
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: interprocess
  Version: Boost 1.54.0 | Severity: Problem
 Keywords: |
---------------------------------------------+--------------------------
 The following code will fail to compile using at least gcc 4.6.3

 {{{
 #include <memory>
 #include <boost/container/scoped_allocator.hpp>
 #include <boost/interprocess/smart_ptr/shared_ptr.hpp>
 namespace bip=boost::interprocess;

 int main(int argc, char* argv[]) {

    class MyDeleter {
    public:
       typedef std::allocator<void>::pointer pointer;
       void operator()(const pointer& ptr){};
    };

    typedef boost::container::scoped_allocator_adaptor<
 std::allocator<void> > Allocator;

    Allocator alloc;

    // next line will fail to compile due to a inaccessible base type error
    bip::shared_ptr<int,Allocator::outer_allocator_type,MyDeleter>
 test1(new int(),alloc);

    //using the outer_allocator will work fine
    bip::shared_ptr<int,Allocator::outer_allocator_type,MyDeleter>
 test2(new int(),alloc);
 };
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/8976>
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:13 UTC