CppUnit project page FAQ CppUnit home page

Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Algorithm.h

Go to the documentation of this file.
00001 #ifndef CPPUNIT_TOOLS_ALGORITHM_H_INCLUDED
00002 #define CPPUNIT_TOOLS_ALGORITHM_H_INCLUDED
00003 
00004 #include <cppunit/Portability.h>
00005 
00006 CPPUNIT_NS_BEGIN
00007 
00008 template<class SequenceType, class ValueType>
00009 void
00010 removeFromSequence( SequenceType &sequence, 
00011                     const ValueType &valueToRemove )
00012 {
00013    for ( unsigned int index =0; index < sequence.size(); ++index )
00014    {
00015       if ( sequence[ index ] == valueToRemove )
00016          sequence.erase( sequence.begin() + index );
00017    }
00018 }
00019 
00020 CPPUNIT_NS_END
00021 
00022 
00023 #endif // CPPUNIT_TOOLS_ALGORITHM_H_INCLUDED

SourceForge Logo hosts this site. Send comments to:
CppUnit Developers