Panda3D
firstOfPairCompare.h
1 // Filename: firstOfPairCompare.h
2 // Created by: drose (27Jun01)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef FIRSTOFPAIRCOMPARE_H
16 #define FIRSTOFPAIRCOMPARE_H
17 
18 #include "pandabase.h"
19 
20 ////////////////////////////////////////////////////////////////////
21 // Class : FirstOfPairCompare
22 // Description : An STL function object class, this is intended to be
23 // used on any ordered collection of pairs of objects.
24 // It invokes the indicated comparison function object
25 // on the first object of its pair.
26 ////////////////////////////////////////////////////////////////////
27 template<class ObjectType, class Compare>
29 public:
30  INLINE FirstOfPairCompare(Compare compare = Compare());
31  INLINE bool operator () (const ObjectType &a, const ObjectType &b) const;
32  Compare _compare;
33 };
34 
35 #include "firstOfPairCompare.I"
36 
37 #endif
38 
An STL function object class, this is intended to be used on any ordered collection of pairs of objec...
bool operator()(const ObjectType &a, const ObjectType &b) const
Returns true if a sorts before b, false otherwise.