fix bug in the test in STL build (where std::vector uses operator=() and not copy ctor to copy objects around, at least with g++)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56189 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
e7bed112b8
commit
252ead2e54
@ -47,7 +47,7 @@ private:
|
||||
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
|
||||
@ -57,6 +57,10 @@ public:
|
||||
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;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user