You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
#include "<strong>Poco</strong>/AutoPtr.h"<br />
using <strong>Poco</strong>::AutoPtr;<br />
class RCO<br />
{<br />
public:<br />
RCO(): _rc(1)<br />
{<br />
}<br />
void duplicate()<br />
{<br />
++_rc; // Warning: not thread safe!<br />
}<br />
void release()<br />
{<br />
if (--_rc == 0) delete this; // Warning: not thread safe!<br />
}<br />
private:<br />
int _rc;<br />
};