From cae3d20badb7edef6de1cda979c719bd0d65b655 Mon Sep 17 00:00:00 2001 From: Baptiste Lepilleur Date: Tue, 11 Mar 2003 19:19:53 +0000 Subject: Include/cppunit/tools/Algorithm. include/cppunit/tools/Algorithm.h: * src/cppunit/TestResult.cpp: * src/msvc6/testrunner/TestRunnerModel.cpp: added removeFromSequence algorithm in Algorithm.h to fix STLPort compatibility issue (std::remove use the one of cstdio instead of algorithm). Bug #694971. * include/cppunit/extensions/TestNamer.h: fixed bug #662666 (missing include for typeinfo). * src/cppunit/TestResult.cpp: TestFailure are no longer passed as temporary, but explicitely instantiated on the stack. Work around AIX compiler bug. --- include/cppunit/tools/Algorithm.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 include/cppunit/tools/Algorithm.h (limited to 'include/cppunit/tools/Algorithm.h') diff --git a/include/cppunit/tools/Algorithm.h b/include/cppunit/tools/Algorithm.h new file mode 100644 index 0000000..2eb1c6f --- /dev/null +++ b/include/cppunit/tools/Algorithm.h @@ -0,0 +1,27 @@ +#ifndef CPPUNIT_TOOLS_ALGORITHM_H_INCLUDED +#define CPPUNIT_TOOLS_ALGORITHM_H_INCLUDED + +#include + +CPPUNIT_NS_BEGIN + +template +void +removeFromSequence( SequenceType &sequence, + const ItemType &valueToRemove ) +{ + Sequence::iterator it = sequence.begin(); + Sequence::iterator itEnd = sequence.end(); + while ( it != itEnd ) + { + if ( *it == valueToRemove ) + it = sequence.erase( it ); + else + ++it; + } +} + +CPPUNIT_NS_END + + +#endif // CPPUNIT_TOOLS_ALGORITHM_H_INCLUDED \ No newline at end of file -- cgit v1.2.1