git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56189
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
int CountedObject::ms_count = 0;
// ----------------------------------------------------------------------------
int CountedObject::ms_count = 0;
// ----------------------------------------------------------------------------
-// simple class capable of checking it's this pointer validity
+// simple class capable of checking its "this" pointer validity
// ----------------------------------------------------------------------------
class SelfPointingObject
// ----------------------------------------------------------------------------
class SelfPointingObject
SelfPointingObject(const SelfPointingObject&) { m_self = this; }
~SelfPointingObject() { CPPUNIT_ASSERT( this == m_self ); }
SelfPointingObject(const SelfPointingObject&) { m_self = this; }
~SelfPointingObject() { CPPUNIT_ASSERT( this == m_self ); }
+ // the assignment operator should not modify our "this" pointer so
+ // implement it just to prevent the default version from doing it
+ SelfPointingObject& operator=(const SelfPointingObject&) { return *this; }
+
private:
SelfPointingObject *m_self;
};
private:
SelfPointingObject *m_self;
};