T | Class or struct to sort, it must have a member function name() returning S. | |
S | The type returned by the member function T::name(). |
Usage example
#include <list> #include "stringutil.h" struct Demo { const std::string& name() const { return name_; } Demo(const std::string& name) : name_(name) {} std::string name_; }; void foo() { std::list<Demo*> list; list.push_back(new Demo("a")); list.push_back(new Demo("B")); list.push_back(new Demo("c")); // descending case-insensitive sort list.sort(OSB_LIB::GreaterName<Demo*>(true)); }
Definition at line 460 of file stringutil.h.
OSB_LIB::GreaterName< T, S >::GreaterName | ( | bool | ignoreCase = false |
) | [inline] |
bool OSB_LIB::GreaterName< T, S >::operator() | ( | const T & | lhs, | |
const T & | rhs | |||
) | const [inline] |
The comparison function.
Definition at line 468 of file stringutil.h.
References OSB_LIB::GreaterName< T, S >::ignoreCase_.
bool OSB_LIB::GreaterName< T, S >::ignoreCase_ [private] |
Flag to ignore the case when comparing the 2 names.
Definition at line 477 of file stringutil.h.
Referenced by OSB_LIB::GreaterName< T, S >::operator()().