Boost logo

Boost Users :

From: nobody (yg-boost-users_at_[hidden])
Date: 2002-09-20 09:23:03


Hi!

There is a intrusive_ptr.cpp in boost 1.28, but I did not find any doc
for that... exept for in the timing .

Why?

Guessing from the name, intrusive_ptr requires the pointed-to object to
store the reference count or something like that, doesn't it?

And what does anybody think of typedefing std::auto_ptr to
boost::single_ptr?

Finally I have a suggestion for a new type of smart pointer one could
call "notifying_ptr": Sometimes all weak pointing objects need to be
notified when the object pointed to is destroyed: e.g. in a game some
units are set to attack some building, so they store a weak_ptr to the
building, but when that building is destroyed, it would be easier to
implement and faster performing, if the units got a message so they can
look for a new target, instead of having strong pointers, marking the
building as dead, and polling for that state every time the unit does
something. It could be quite some time until all units have realized
that the building is gone and it really can be released from memory.

Regards


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