سؤال

I once heard that it is possible to map the Boost shared_ptr or intrusive_ptr reference add and release functions to my own implementations of add and release reference functions.

Is this really possible? If yes, can anyone point me to some resources regarding this feature?

Thanks!

هل كانت مفيدة؟

المحلول

Not with shared_ptr itself; the only behaviour you can specify is the deleter. There's intrusive_ptr if you want to manage your own reference counting.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top