其他分享
首页 > 其他分享> > class refobj

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智能指针

标签:return,refcount,long,public,refobj,virtual,class
来源: https://www.cnblogs.com/hshy/p/14693257.html