int Add()
return ++m_cRef;
int Release()
int cRef;
// Wskazówka 86.
— mcRef; cRef = m_cRef; if(!cRef)
delete this; return cRef;
void Hello()
cout « "RefCount = cout« m_cRef; cout« "\n";
void TestRefCounted()
#ifdef NOCOMPILE RefCounted ref;
#endif
RefCounted *pref;
// Wskazówka 46.
pref = RefCounted::newRefCounted();
pref->Add();
pref->Hello();
pref->Release();
pref->Hello();
pref->Release();