~ubuntu-branches/ubuntu/oneiric/psi/oneiric

« back to all changes in this revision

Viewing changes to third-party/cppunit/cppunit/include/cppunit/tools/Algorithm.h

  • Committer: Bazaar Package Importer
  • Author(s): Jan Niehusmann
  • Date: 2009-09-25 17:49:51 UTC
  • mfrom: (6.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20090925174951-lvm7kdap82o8xhn3
Tags: 0.13-1
* Updated to upstream version 0.13
* Set Standards-Version to 3.8.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
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