24 #include <boost/intrusive_ptr.hpp> 25 #include <boost/static_assert.hpp> 26 #include <boost/type_traits.hpp> 29 class ComPtr :
public boost::intrusive_ptr<T>
31 BOOST_STATIC_ASSERT((boost::is_base_of<IUnknown, T>::value));
35 ComPtr(T* p,
bool add_ref =
false);
43 : boost::intrusive_ptr<T>()
49 : boost::intrusive_ptr<T>(p, add_ref)
55 : boost::intrusive_ptr<T>(r)
62 : boost::intrusive_ptr<T>(r)
66 inline void intrusive_ptr_add_ref(IUnknown* p)
71 inline void intrusive_ptr_release(IUnknown* p)