source: trunk/contrib/cppunit-1.12.2/include/cppunit/tools/Algorithm.h @ 876

Last change on this file since 876 was 876, checked in by sam, 9 years ago

contrib: add a precompiled Win32 version of CppUnit and update build system
accordingly.

File size: 533 bytes
Line 
1#ifndef CPPUNIT_TOOLS_ALGORITHM_H_INCLUDED
2#define CPPUNIT_TOOLS_ALGORITHM_H_INCLUDED
3
4#include <cppunit/Portability.h>
5
6CPPUNIT_NS_BEGIN
7
8template<class SequenceType, class ValueType>
9void
10removeFromSequence( 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
20CPPUNIT_NS_END
21
22
23#endif // CPPUNIT_TOOLS_ALGORITHM_H_INCLUDED
Note: See TracBrowser for help on using the repository browser.