Files
2025-10-25 03:02:53 +03:00

2.1 KiB
Raw Permalink Blame History

[locale.operators]

28 Text processing library [text]

28.3 Localization library [localization]

28.3.3 Locales [locales]

28.3.3.1 Class locale [locale]

28.3.3.1.5 Operators [locale.operators]

🔗

bool operator==(const locale& other) const;

1

#

Returns: true if both arguments are the same locale, or one is a copy of the other, or each has a name and the names are identical;false otherwise.

🔗

template<class charT, class traits, class Allocator> bool operator()(const basic_string<charT, traits, Allocator>& s1, const basic_string<charT, traits, Allocator>& s2) const;

2

#

Effects: Compares two strings according to the std::collate facet.

3

#

Returns: use_facet<std::collate>(*this).compare(s1.data(), s1.data() + s1.size(), s2.data(), s2.data() + s2.size()) < 0

4

#

Remarks: This member operator template (and therefore locale itself) meets the requirements for a comparator predicate template argument ([algorithms]) applied to strings.

5

#

[Example 1:

A vector of strings v can be collated according to collation rules in locale loc simply by ([alg.sort], [vector]):

std::sort(v.begin(), v.end(), loc); — end example]