From 252ead2e54dd657e471391f6ffd0375546636417 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 9 Oct 2008 09:33:13 +0000 Subject: [PATCH] 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 --- tests/vectors/vectors.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/vectors/vectors.cpp b/tests/vectors/vectors.cpp index 8ebb8b5259..9f7ab2bab9 100644 --- a/tests/vectors/vectors.cpp +++ b/tests/vectors/vectors.cpp @@ -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; };