[C++-sig] expose class that does it's own ref counting

David Sveningsson ext at sidvind.com
Fri Apr 27 10:35:21 CEST 2007

Neal Becker skrev:
> I'm interested to play with exposing blitz++ arrays.  They do there own ref
> counting.  Do I need to do anything special?  I'm thinking that I can just
> ignore this fact, and nothing bad will happen (except maybe some
> inefficiency).  Is this correct?
Try using boost::intrusive_ptr as container for the classes. Worked for 
me when I did something similar. boost::intrusive_ptr requires you to 
write two additional functions, intrusive_ptr_add_ref and 
intrusive_ptr_release which takes a pointer as parameter should 
increases and decrease the refcount.


//*David Sveningsson [eXt]*

Freelance coder | Game Development Student

Thou shalt make thy program's purpose and structure clear to thy fellow man by using the One True Brace Style, even if thou likest it not, for thy creativity is better used in solving problems than in creating beautiful new impediments to understanding.

More information about the Cplusplus-sig mailing list