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.
21 #ifndef __stl_functors_h__
22 #define __stl_functors_h__
27 struct less<std::string *> {
28 bool operator()(std::string *s1, std::string *s2) const {
33 #endif // LESS_STRING_P
35 #ifndef LESS_CONST_STRING_P
36 struct less<const std::string *> {
37 bool operator()(const std::string *s1, const std::string *s2) const {
41 #define LESS_CONST_STRING_P
42 #endif // LESS_CONST_STRING_P
44 #ifndef LESS_CONST_CHAR_P
45 struct less<const char *>
47 bool operator()(const char* s1, const char* s2) const {
48 return strcmp(s1, s2) < 0;
51 #define LESS_CONST_CHAR_P
52 #endif // LESS_CONST_CHAR_P
54 #ifndef LESS_CONST_FLOAT_P
55 struct less<const float *>
57 bool operator()(const float *n1, const float *n2) const {
61 #define LESS_CONST_FLOAT_P
62 #endif // LESS_CONST_FLOAT_P
64 #ifndef EQUAL_TO_CONST_CHAR_P
65 struct equal_to<const char *>
67 bool operator()(const char *s1, const char *s2) const {
68 return strcmp (s1, s2) == 0;
71 #define EQUAL_TO_CONST_CHAR_P
72 #endif // EQUAL_TO_CONST_CHAR_P
74 #ifndef EQUAL_TO_STRING_P
75 struct equal_to<std::string *>
77 bool operator()(const std::string *s1, const std::string *s2) const {
81 #define EQUAL_TO_STRING_P
82 #endif // EQUAL_TO_STRING_P
84 #ifndef LESS_CONST_STRING_R
85 struct less<const std::string &> {
86 bool operator() (const std::string &s1, const std::string &s2) {
90 #define LESS_CONST_STRING_R
91 #endif // EQUAL_TO_STRING_P
93 #endif // __stl_functors_h__