Boost logo

Boost Users :

From: Ion Gaztañaga (igaztanaga_at_[hidden])
Date: 2007-01-20 13:12:20


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


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net