Boost logo

Boost :

From: Fernando Cacciola (fcacciola_at_[hidden])
Date: 2002-04-19 15:35:22


 int main()
{
  boost::intrusive_ptr<X> px(new X); // obj's internal count=1
  boost::intrusive_ptr<X> px2(px); // obj's internal count=2
  boost::shared_ptr<X> px3(px2); // obj's internal count still =2, detached
count=1

  px = 0; // obj's internal count=1
  px2 = 0; // obj's internal count=0 -----> obj suicides itself....

*px3 ; // undefined behavior, pointee no longer alive.
 }

What I am missing?

--
Fernando Cacciola
Sierra s.r.l.
fcacciola_at_[hidden]
www.gosierra.com

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