Sure Ion,
thanks for answering.
Commenting or uncommenting the last line (the one with insert) you get the
compilation error.
I don?t know how to insert something into the multimap...
Thanks in advance
(I tried to follow the code behind flat_tree but got confused as I think a
std::pair is what's expected??)
---------------
#include <vector>
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
class myShmNode
{
//whatever
};
typedef boost::shmem::allocator myShmNodePtrAllocator;
typedef boost::shmem::flat_multimap, myShmNodePtrAllocator> MyMultiMap;
int main(int argc, char *argv[])
{
boost::shmem::named_shared_object segment;
segment.create( "/MySharedMemory", 1048576 );
//Initialize shared memory STL-compatible allocators
myShmNodePtrAllocator nodesPtrsAllocator(segment.get_segment_manager());
std::less comparator2;
MyMultiMap*
ptrsMultiMap=segment.construct<MyMultiMap>(boost::shmem::anonymous_instance)
(comparator2,nodesPtrsAllocator);
typedef std::pair multiMapNodeType;
multiMapNodeType multiMapNode;
myShmNode* myNode;
multiMapNode.first = 1;
multiMapNode.second = myNode;
ptrsMultiMap->insert(multiMapNode);
}