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