Boost logo

Boost :

Subject: Re: [boost] Making friend with boost::interprocess
From: Oncaphillis (oncaphillis_at_[hidden])
Date: 2009-03-11 14:24:37


 Hi Ion

thanks for the reply
> Oncaphillis wrote:
>
>> Of course somewhere deep in the guts of boost I get an error since
>> the Foo constructor is private. Who do I have to befriend in order
>> to make this scheme work ?
>
> At this moment you have no possibility of constructing
> non-constructible objects in shared memory.
Don't know if I get that right. My real world objects constructs just
fine when I make the constructor
public. The only problem I have is that:

<snip>
 segment.find_or_construct<Foo>("FooObject")(alloc);
</snip>

complains that my constructor is private:
within this context:

<snip>
# if BOOST_PP_LOCAL_C(1)
        BOOST_PP_LOCAL_MACRO(1)
# endif
</snip>

which isn't very helpful. I already tried to make
class managed_shared_memory a friend. But
since managed_shared_memory is just a typedef
from basic_shared_memory<...> that doesn't work
either.

Thanks again

O.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk