2 Copyright (C) 1998-99 Paul Barton-Davis
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #ifndef __stl_functors_h__
21 #define __stl_functors_h__
26 struct less<std::string *> {
27 bool operator()(std::string *s1, std::string *s2) const {
32 #endif // LESS_STRING_P
34 #ifndef LESS_CONST_STRING_P
35 struct less<const std::string *> {
36 bool operator()(const std::string *s1, const std::string *s2) const {
40 #define LESS_CONST_STRING_P
41 #endif // LESS_CONST_STRING_P
43 #ifndef LESS_CONST_CHAR_P
44 struct less<const char *>
46 bool operator()(const char* s1, const char* s2) const {
47 return strcmp(s1, s2) < 0;
50 #define LESS_CONST_CHAR_P
51 #endif // LESS_CONST_CHAR_P
53 #ifndef LESS_CONST_FLOAT_P
54 struct less<const float *>
56 bool operator()(const float *n1, const float *n2) const {
60 #define LESS_CONST_FLOAT_P
61 #endif // LESS_CONST_FLOAT_P
63 #ifndef EQUAL_TO_CONST_CHAR_P
64 struct equal_to<const char *>
66 bool operator()(const char *s1, const char *s2) const {
67 return strcmp (s1, s2) == 0;
70 #define EQUAL_TO_CONST_CHAR_P
71 #endif // EQUAL_TO_CONST_CHAR_P
73 #ifndef EQUAL_TO_STRING_P
74 struct equal_to<std::string *>
76 bool operator()(const std::string *s1, const std::string *s2) const {
80 #define EQUAL_TO_STRING_P
81 #endif // EQUAL_TO_STRING_P
83 #ifndef LESS_CONST_STRING_R
84 struct less<const std::string &> {
85 bool operator() (const std::string &s1, const std::string &s2) {
89 #define LESS_CONST_STRING_R
90 #endif // EQUAL_TO_STRING_P
92 #endif // __stl_functors_h__