(svn r15324) -Codechange: unify the class used for comparing of strings for std::map
This commit is contained in:
15
src/core/string_compare_type.hpp
Normal file
15
src/core/string_compare_type.hpp
Normal file
@@ -0,0 +1,15 @@
|
||||
/* $Id$ */
|
||||
|
||||
/** @file string_compare_type.hpp Comparator class for "const char *" so it can be used as a key for std::map */
|
||||
|
||||
#ifndef STRING_COMPARE_TYPE_HPP
|
||||
#define STRING_COMPARE_TYPE_HPP
|
||||
|
||||
struct StringCompare {
|
||||
bool operator () (const char *a, const char *b) const
|
||||
{
|
||||
return strcmp(a, b) < 0;
|
||||
}
|
||||
};
|
||||
|
||||
#endif /* STRING_COMPARE_TYPE_HPP */
|
Reference in New Issue
Block a user