add comparator functor to the info maps of readerbackend and readerwriteend.

This is required, because after the recent changes the info map containst a
char* as key. Without the comparator the map will compare the char addresses
for all operations - which is not really what we want.
This commit is contained in:
Bernhard Amann 2012-07-24 09:19:20 -07:00
parent 3f21764d00
commit 13952154a1
3 changed files with 13 additions and 2 deletions

View file

@ -345,4 +345,15 @@ inline int safe_vsnprintf(char* str, size_t size, const char* format, va_list al
extern void get_memory_usage(unsigned int* total,
unsigned int* malloced);
// class to be used as a third argument for stl maps to be able to use
// char*'s as keys. Otherwise the pointer values will be compared instead
// of the actual string values.
struct CompareString
{
bool operator()(char const *a, char const *b) const
{
return std::strcmp(a, b) < 0;
}
};
#endif