Multi-byte characters are compared appropriately.
For the standard specialization of char and wchar_t the function returns the same as lexicographical_compare, which performs a character code (ASCII) comparison between the individual characters of both sequences, returning an alphabetical ordering for alphabetical strings.
During its operation, the version of this function in the generic template simply calls the virtual protected member do_compare, which is the member function in charge of performing the actions described above.
- low1, high1
- Pointer to the beginning and ending characters of the first sequence. The range used is [low1,high1), which contains all the characters between low1 and high1, including the character pointed by low1 but not the character pointed by high1.
charT is the template parameter (i.e., the facet's character type).
- low2, high2
- Pointer to the beginning and ending characters of the second sequence. The range used is [low2,high2).
Return value1 if the first string is greater than the second.
-1 if the first string is less than the second.
0 otherwise (i.e., they are considered equal).
STRAWBERRY is greater than BLUEBERRY
|collate::transform||Transform character sequence (public member function)|
|collate::hash||Get hash value (public member function)|
|lexicographical_compare||Lexicographical less-than comparison (function template)|