boost interval container in shared memory
I have been trying to store boost interval map in shared memory, but my code below does not compile when I pass allocator while constructing map. After seeing template definition of boost interval_map I assume that boost icl only supports std::allocator. Is there any way to store this container in shared memory. int main () { static bip::managed_shared_memory global_mm(boost::interprocess::open_or_create, "MySharedMemory",65536 //segment name ); static bip::allocator<void, bip::managed_shared_memory::segment_manager> global_alloc(global_mm.get_segment_manager()); boost::icl::interval_map<int, int> *party = global_mm.find_or_construct<boost::icl::interval_map<int, int>>("Store")(global_alloc); party->add(make_pair(boost::icl::interval<int>::right_open(4,5),1)); std::cout << "adding result: " << *party << "\n"; }
participants (1)
-
Asna Ishrat