CppUnit project page FAQ

Algorithm.h
Go to the documentation of this file.
1 #ifndef CPPUNIT_TOOLS_ALGORITHM_H_INCLUDED
2 #define CPPUNIT_TOOLS_ALGORITHM_H_INCLUDED
3 
4 #include <cppunit/Portability.h>
5 
7 
8 template<class SequenceType, class ValueType>
9 void
10 removeFromSequence( SequenceType &sequence,
11  const ValueType &valueToRemove )
12 {
13  for ( unsigned int index =0; index < sequence.size(); ++index )
14  {
15  if ( sequence[ index ] == valueToRemove )
16  sequence.erase( sequence.begin() + index );
17  }
18 }
19 
21 
22 
23 #endif // CPPUNIT_TOOLS_ALGORITHM_H_INCLUDED

Send comments to:
CppUnit Developers