OpenTTD
string_compare_type.hpp
Go to the documentation of this file.
1 /* $Id: string_compare_type.hpp 22411 2011-05-02 17:42:12Z rubidium $ */
2 
3 /*
4  * This file is part of OpenTTD.
5  * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
6  * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
7  * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
8  */
9 
12 #ifndef STRING_COMPARE_TYPE_HPP
13 #define STRING_COMPARE_TYPE_HPP
14 
16 struct StringCompare {
23  bool operator () (const char *a, const char *b) const
24  {
25  return strcmp(a, b) < 0;
26  }
27 };
28 
29 #endif /* STRING_COMPARE_TYPE_HPP */
bool operator()(const char *a, const char *b) const
Compare two strings.
Comparator for strings.