[Boost-bugs] [Boost C++ Libraries] #6533: Can't use map with incomplete type and interprocess allocator

Subject: [Boost-bugs] [Boost C++ Libraries] #6533: Can't use map with incomplete type and interprocess allocator
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-02-07 22:59:09


#6533: Can't use map with incomplete type and interprocess allocator
------------------------------------------------+---------------------------
 Reporter: Erik Jensen <Erik.Jensen@…> | Owner: igaztanaga
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: container
  Version: Boost 1.48.0 | Severity: Problem
 Keywords: |
------------------------------------------------+---------------------------
 A boost::container::map using boost::interprocess::allocator cannot be
 instantiated with an incomplete value type, even though the allocator
 itself can be.

 Sample code:
 {{{
 #include <string>
 #include <boost/interprocess/allocators/allocator.hpp>
 #include <boost/interprocess/containers/map.hpp>
 #include <boost/interprocess/managed_shared_memory.hpp>

 class Incomplete;
 typedef boost::interprocess::allocator<std::pair<std::string, Incomplete>,
     boost::interprocess::managed_shared_memory::segment_manager>
 Allocator;
 typedef boost::interprocess::map<std::string, Incomplete,
     std::less<std::string>, Allocator> IncompleteMap;
 class Incomplete
 {
     Allocator foo; // No error here
     IncompleteMap bar; // Error!
 };
 }}}
 The error occurs as part of the instantiation of
 boost::container::container_detail::is_convertible by
 boost::container::container_detail::impl::extract_version. Using using
 boost::is_convertible instead fixes the problem on Visual Studio 20103

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