![]() |
Provides dictionary ordering binary predicate function on strings. More...
Public Member Functions | |
TF_API bool | operator() (const std::string &lhs, const std::string &rhs) const |
Return true if lhs is less than rhs in dictionary order. More... | |
Provides dictionary ordering binary predicate function on strings.
The TfDictionaryLessThan
class is a functor as defined by the STL standard. It compares strings using "dictionary" order: for example, the following strings are in dictionary order: ["abacus", "Albert", "albert", "baby", "Bert", "file01", "file001", "file2", "file10"]
Note that capitalization matters only if the strings differ by capitalization alone.
Characters whose ASCII value are inbetween upper- and lowercase letters, such as underscore, are sorted to come after all letters.
Definition at line 504 of file stringUtils.h.
TF_API bool operator() | ( | const std::string & | lhs, |
const std::string & | rhs | ||
) | const |
Return true if lhs
is less than rhs
in dictionary order.
Normally this functor is used to supply an ordering functor for STL containers: for example,
If you simply need to compare two strings, you can do so as follows: