
8 Jun
2009
8 Jun
'09
6:14 a.m.
Out of curiosity what was the motivation for deriving from shared_ptr instead of using intrusive_ptr?
shared_ptr simply fitted the bill. Your com_ptr uses IUnkown::AddRef() and IUnkown::Release(), which is arguably slower than using shared_ptr's own reference counting scheme, which mine does. However, I like the ability to construct objects in-place rather than having to first create a 'raw' COM object, then assigning it to a com_ptr<T> Regards, Christian.