Re: [Boost-bugs] [Boost C++ Libraries] #11713: boost::interprocess::basic_string instantiation broken

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #11713: boost::interprocess::basic_string instantiation broken
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-10-07 13:38:21


#11713: boost::interprocess::basic_string instantiation broken
--------------------------------+--------------------------
  Reporter: kaparis.dimitri@… | Owner: igaztanaga
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: interprocess
   Version: Boost 1.59.0 | Severity: Regression
Resolution: | Keywords:
--------------------------------+--------------------------

Comment (by kaparis.dimitri@…):

 Replying to [comment:1 kaparis.dimitri@…]:
> The same problem affects example 33.10 of the chapter on Managed Shared
 Memory of "The Boost C++ Libraries" book
 (http://theboostcpplibraries.com/boost.interprocess-managed-shared-
 memory):
>

 Sorry, copied wrong example.
 This is the correct one:

 {{{

 #include <boost/interprocess/managed_shared_memory.hpp>
 #include <boost/interprocess/allocators/allocator.hpp>
 #include <boost/interprocess/containers/string.hpp>
 #include <iostream>

 using namespace boost::interprocess;

 int main()
 {
   shared_memory_object::remove("Boost");
   managed_shared_memory managed_shm{open_or_create, "Boost", 1024};
   typedef allocator<char,
     managed_shared_memory::segment_manager> CharAllocator;
   typedef basic_string<char, std::char_traits<char>, CharAllocator>
 string;
   string *s = managed_shm.find_or_construct<string>("String")("Hello!",
     managed_shm.get_segment_manager());
   s->insert(5, ", world");
   std::cout << *s << '\n';
 }

 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/11713#comment:2>
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:19 UTC