tmp/tmpt7fgvf5o/{from.md → to.md}
RENAMED
|
@@ -30,20 +30,20 @@ namespace std {
|
|
| 30 |
```
|
| 31 |
|
| 32 |
The class `collate<charT>` provides features for use in the collation
|
| 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
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
|
| 41 |
Each function compares a string of characters `*p` in the range \[`low`,
|
| 42 |
`high`).
|
| 43 |
|
| 44 |
-
#####
|
| 45 |
|
| 46 |
``` cpp
|
| 47 |
int compare(const charT* low1, const charT* high1,
|
| 48 |
const charT* low2, const charT* high2) const;
|
| 49 |
```
|
|
@@ -60,22 +60,22 @@ string_type transform(const charT* low, const charT* high) const;
|
|
| 60 |
long hash(const charT* low, const charT* high) const;
|
| 61 |
```
|
| 62 |
|
| 63 |
*Returns:* `do_hash(low, high)`.
|
| 64 |
|
| 65 |
-
#####
|
| 66 |
|
| 67 |
``` cpp
|
| 68 |
int do_compare(const charT* low1, const charT* high1,
|
| 69 |
const charT* low2, const charT* high2) const;
|
| 70 |
```
|
| 71 |
|
| 72 |
*Returns:* `1` if the first string is greater than the second, `-1` if
|
| 73 |
less, zero otherwise. The specializations required in
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
|
| 78 |
``` cpp
|
| 79 |
string_type do_transform(const charT* low, const charT* high) const;
|
| 80 |
```
|
| 81 |
|
|
@@ -105,10 +105,11 @@ namespace std {
|
|
| 105 |
public:
|
| 106 |
using string_type = basic_string<charT>;
|
| 107 |
|
| 108 |
explicit collate_byname(const char*, size_t refs = 0);
|
| 109 |
explicit collate_byname(const string&, size_t refs = 0);
|
|
|
|
| 110 |
protected:
|
| 111 |
~collate_byname();
|
| 112 |
};
|
| 113 |
}
|
| 114 |
```
|
|
|
|
| 30 |
```
|
| 31 |
|
| 32 |
The class `collate<charT>` provides features for use in the collation
|
| 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 lexicographic ordering
|
| 39 |
+
[[alg.lex.comparison]].
|
| 40 |
|
| 41 |
Each function compares a string of characters `*p` in the range \[`low`,
|
| 42 |
`high`).
|
| 43 |
|
| 44 |
+
##### Members <a id="locale.collate.members">[[locale.collate.members]]</a>
|
| 45 |
|
| 46 |
``` cpp
|
| 47 |
int compare(const charT* low1, const charT* high1,
|
| 48 |
const charT* low2, const charT* high2) const;
|
| 49 |
```
|
|
|
|
| 60 |
long hash(const charT* low, const charT* high) const;
|
| 61 |
```
|
| 62 |
|
| 63 |
*Returns:* `do_hash(low, high)`.
|
| 64 |
|
| 65 |
+
##### Virtual functions <a id="locale.collate.virtuals">[[locale.collate.virtuals]]</a>
|
| 66 |
|
| 67 |
``` cpp
|
| 68 |
int do_compare(const charT* low1, const charT* high1,
|
| 69 |
const charT* low2, const charT* high2) const;
|
| 70 |
```
|
| 71 |
|
| 72 |
*Returns:* `1` if the first string is greater than the second, `-1` if
|
| 73 |
less, zero otherwise. The specializations required in
|
| 74 |
+
[[locale.category.facets]][[locale.category]], namely `collate<char>`
|
| 75 |
+
and `collate<wchar_t>`, implement a lexicographical
|
| 76 |
+
comparison [[alg.lex.comparison]].
|
| 77 |
|
| 78 |
``` cpp
|
| 79 |
string_type do_transform(const charT* low, const charT* high) const;
|
| 80 |
```
|
| 81 |
|
|
|
|
| 105 |
public:
|
| 106 |
using string_type = basic_string<charT>;
|
| 107 |
|
| 108 |
explicit collate_byname(const char*, size_t refs = 0);
|
| 109 |
explicit collate_byname(const string&, size_t refs = 0);
|
| 110 |
+
|
| 111 |
protected:
|
| 112 |
~collate_byname();
|
| 113 |
};
|
| 114 |
}
|
| 115 |
```
|