Imported Upstream version 2.81
[platform/upstream/libbullet.git] / UnitTests / cppunit / include / cppunit / tools / Algorithm.h
1 #ifndef CPPUNIT_TOOLS_ALGORITHM_H_INCLUDED
2 #define CPPUNIT_TOOLS_ALGORITHM_H_INCLUDED
3
4 #include <cppunit/Portability.h>
5
6 CPPUNIT_NS_BEGIN
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
20 CPPUNIT_NS_END
21
22
23 #endif // CPPUNIT_TOOLS_ALGORITHM_H_INCLUDED