1 Feb
2005
1 Feb
'05
8:23 a.m.
Brian Neal wrote:
Hi, I need some help understanding when and why you would want to use intrusive_ptr. Does someone have an example? I didn't get much out of the current documentation for it. Thank you.
For the Coin library (an OpenInventor implementation). // declare add-ref/rm-ref functions inline void intrusive_ptr_add_ref( SoNode* n ) { n->ref(); } inline void intrusive_ptr_release( SoNode* n ) { n->unref(); } now: intrusive_ptr<SoGroup> root; will perform like a shared_ptr, except it will do ref() and unref() instead of deletes. Very useful. Paul