Newbie question conerning interprocess stuff
Hi,
I'm a complete newbie with boost and have a question concerning the
interprocess stuff.
I took the piece of code to share a vector in shared memory between two
processes from the quick-start guide as a start point and it compiled
and ran immediately with success for me.
Then I tried to replace the vector by a map:
#include
Wolfgang Hottgenroth wrote:
Hi,
I'm a complete newbie with boost and have a question concerning the interprocess stuff.
I took the piece of code to share a vector in shared memory between two processes from the quick-start guide as a start point and it compiled and ran immediately with success for me.
Then I tried to replace the vector by a map:
[snip]
I think it is the segment.construct line, although I don't find a direct hint in the error message from the compiler, but if I comment out this line, the compiler is happy.
Has any one any hint for me?
Map's constructor is: map(const Compare &comp, const allocator_type &a=allocator_type()) so you have to pass the comparison functor apart from the allocator. Try this: MyMap *mymap = segment.construct<MyMap>("MyMap")(std::less<int>(), alloc_inst);
Thank you very much, Wolfgang
Regards, Ion
participants (2)
-
Ion GaztaƱaga
-
Wolfgang Hottgenroth