Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2007-05-09 12:25:49

on Tue May 08 2007, "Michael Gopshtein" <> wrote:

> "Atry" <pop.atry_at_[hidden]> wrote in message
>> Yes, "defragment" or other automation memory management is useful, but the
>> existing code depends on native pointer would be very hard to work
>> together,
>> almost all C++ code need to recode if they want to use these futures.
> I do "feel" that just moving object's memory is not safe, but can't find
> explanation why it will cause problems. Can you give an example of a class
> for which this will not work?

  struct B;

  struct A {
    A(B*p) : p(p) {}
    B* p;

  struct B : noncopyable {
    B() : px(new A(this)) {}
    auto_ptr<A> px; // invariant: px->p == this

Dave Abrahams
Boost Consulting
Don't Miss BoostCon 2007! ==>

Boost list run by bdawes at, gregod at, cpdaniel at, john at