Boost logo

Boost Users :

Subject: Re: [Boost-users] [Interprocess] Collection of base shared_ptr
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2012-04-10 23:54:21


AMDG

On 04/10/2012 11:58 AM, Aaron_Wright_at_[hidden] wrote:
> If I read that web page correctly, the only time raw pointers are used is
> when creating a backup for when a copy constructor fails. From the reading
> it would seem that the backup point is not persisted. When the copy
> constructor fails, the backup is copied off the heap into variant's
> storage.

No. In this case, the backup isn't copied
because that could also throw, and then
how could we preserve the invariants?
If the copy constructor fails, Boost.Variant
simply stores the pointer to the heap backup.

> When the copy constructor doesn't fail, the backup is discarded.
> This raw pointer would only be needed for a small moment in one process.
> It would not need to be shared with another process. So variant should
> work fine with interprocess.
>
> I'm making some assumptions here that that web page contains everything I
> need to know. Am I assuming too much?
>

In Christ,
Steven Watanabe


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