Quantcast
Channel: Publish/Subscribe and Smart pointer - Stack Overflow
Viewing all articles
Browse latest Browse all 3

Answer by Franci Penov for Publish/Subscribe and Smart pointer

$
0
0

What you describe is the classic COM pattern for object lifetime control. You need a smart pointer that keeps reference counter on the object - boost::shared_ptr, boost::intrusive_ptr or ATL's CComPtr class. I would suggest shared_ptr, as the other two will require your own implementation of the ref counting.


Viewing all articles
Browse latest Browse all 3

Trending Articles