Boost logo

Boost :

Subject: Re: [boost] [interprocess] preparing containers
From: Thorsten Ottosen (thorsten.ottosen_at_[hidden])
Date: 2008-12-03 04:17:34


Ion Gaztañaga skrev:
> Thorsten Ottosen wrote:
[snip]
>> In particular, if I want to use boost::ptr_vector, then do I need to
>> have stateful allocators (both the normal container allocator, and the
>> clone_allocator)?
>
> Sorry, I'm not familiar with ptr_containers. If you can give me some
> hints on what's clone_allocator for, I'll be glad to help you to make
> ptr_container compatible with shared memory allocators. Just one issue:
> shared memory does not support virtual functions, so I don't think
> polymorphic cloning will be usable at all.

Currently the clone-allocators are a stateless customization point for
cloning. It tells the containers how to clone the (indirectly) held
pointees.

I guess support for virtual functions is needed, except for the most
trivial cases. So what does it mean exactly, that shared memory does not
support virtual functions? Can I never call a virtual function on an
object if that object's memory is shared? (In which case I'm a bit
puzzled :-))

-Thorsten


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