class refobj

 #include<windows.h>
class refobj { public: refobj() : m_refcount(0) {} virtual long addref() { return InterlockedIncrement(&m_refcount); } virtual long release() { long r = InterlockedDecrement(&m_refcount); if(!r) delete this; return r; } protected: virtual ~refobj() {} long m_refcount; private: }; class DTMFBuffer:public refobj { }

  使用autoptr智能指针

posted on 2021-04-23 12:35  lydstory  阅读(50)  评论(0)    收藏  举报

导航