std::collate_byname
From cppreference.com
Defined in header <locale>
|
||
template< class CharT >
class collate_byname : public std::collate<CharT>; |
||
std::collate_byname is a std::collate facet which encapsulates locale-specific collation (comparison) and hashing of strings. Just like std::collate, it can be imbued in std::regex and applied, by means of std::locale::operator(), directly to all standard algorithms that expect a string comparison predicate.
Two specializations are provided by the standard library
Defined in header
<locale> | |
std::collate_byname<char> | locale-specific collation of multibyte strings |
std::collate_byname<wchar_t> | locale-specific collation of wide strings |
Contents |
[edit] Member functions
constructs a new collate_byname facet (public member function) |
|
destructs a collate_byname facet (protected member function) |
Inherited from std::collate
Member types
Member type | Definition |
char_type
|
charT
|
string_type
|
std::basic_string<charT>
|
Member functions
invokes do_compare (public member function of std::collate )
|
|
invokes do_transform (public member function of std::collate )
|
|
invokes do_hash (public member function of std::collate )
|
Protected member functions
[virtual]
|
compares two strings using this facet's collation rules (virtual protected member function of std::collate )
|
[virtual]
|
transforms a string so that collation can be replaced by comparison (virtual protected member function of std::collate )
|
[virtual]
|
generates an integer hash value using this facet's collation rules (virtual protected member function of std::collate )
|
[edit] Notes
Collation order is typically lexicographic case-insensitive comparison according to the locale's alphabet, but in some locales, groups of characters compare as single collation units. For example, "ch" in Czech follows "h" and precedes "i", and "ng" in Welsh follows "g" and precedes "h".
[edit] Example
This section is incomplete Reason: no example |
[edit] See also
defines lexicographical comparison and hashing of strings (class template) |
|
compares two strings in accordance to the current locale (function) |
|
compares two wide strings in accordance to the current locale (function) |
|
lexicographically compares two strings using this locale's collate facet (public member function of std::locale )
|