tmp/tmp016gvu23/{from.md → to.md}
RENAMED
|
@@ -1,7 +1,9 @@
|
|
| 1 |
#### Class template `collate` <a id="locale.collate">[[locale.collate]]</a>
|
| 2 |
|
|
|
|
|
|
|
| 3 |
``` cpp
|
| 4 |
namespace std {
|
| 5 |
template<class charT>
|
| 6 |
class collate : public locale::facet {
|
| 7 |
public:
|
|
@@ -31,11 +33,11 @@ The class `collate<charT>` provides features for use in the collation
|
|
| 31 |
(comparison) and hashing of strings. A locale member function template,
|
| 32 |
`operator()`, uses the collate facet to allow a locale to act directly
|
| 33 |
as the predicate argument for standard algorithms [[algorithms]] and
|
| 34 |
containers operating on strings. The specializations required in
|
| 35 |
[[locale.category.facets]] [[locale.category]], namely `collate<char>`
|
| 36 |
-
and `collate<wchar_t>`, apply
|
| 37 |
[[alg.lex.comparison]].
|
| 38 |
|
| 39 |
Each function compares a string of characters `*p` in the range \[`low`,
|
| 40 |
`high`).
|
| 41 |
|
|
@@ -88,9 +90,9 @@ long do_hash(const charT* low, const charT* high) const;
|
|
| 88 |
|
| 89 |
*Returns:* An integer value equal to the result of calling `hash()` on
|
| 90 |
any other string for which `do_compare()` returns 0 (equal) when passed
|
| 91 |
the two strings.
|
| 92 |
|
| 93 |
-
|
| 94 |
-
string which does not compare equal should be very small,
|
| 95 |
-
`(1.0/numeric_limits<unsigned long>::max())`.
|
| 96 |
|
|
|
|
| 1 |
#### Class template `collate` <a id="locale.collate">[[locale.collate]]</a>
|
| 2 |
|
| 3 |
+
##### General <a id="locale.collate.general">[[locale.collate.general]]</a>
|
| 4 |
+
|
| 5 |
``` cpp
|
| 6 |
namespace std {
|
| 7 |
template<class charT>
|
| 8 |
class collate : public locale::facet {
|
| 9 |
public:
|
|
|
|
| 33 |
(comparison) and hashing of strings. A locale member function template,
|
| 34 |
`operator()`, uses the collate facet to allow a locale to act directly
|
| 35 |
as the predicate argument for standard algorithms [[algorithms]] and
|
| 36 |
containers operating on strings. The specializations required in
|
| 37 |
[[locale.category.facets]] [[locale.category]], namely `collate<char>`
|
| 38 |
+
and `collate<wchar_t>`, apply lexicographical ordering
|
| 39 |
[[alg.lex.comparison]].
|
| 40 |
|
| 41 |
Each function compares a string of characters `*p` in the range \[`low`,
|
| 42 |
`high`).
|
| 43 |
|
|
|
|
| 90 |
|
| 91 |
*Returns:* An integer value equal to the result of calling `hash()` on
|
| 92 |
any other string for which `do_compare()` returns 0 (equal) when passed
|
| 93 |
the two strings.
|
| 94 |
|
| 95 |
+
*Recommended practice:* The probability that the result equals that for
|
| 96 |
+
another string which does not compare equal should be very small,
|
| 97 |
+
approaching `(1.0/numeric_limits<unsigned long>::max())`.
|
| 98 |
|