tmp/tmpwocjoixf/{from.md → to.md}
RENAMED
|
@@ -14,25 +14,25 @@ template<class charT, class traits, class Allocator>
|
|
| 14 |
const basic_string<charT, traits, Allocator>& s2) const;
|
| 15 |
```
|
| 16 |
|
| 17 |
*Effects:* Compares two strings according to the `collate<charT>` facet.
|
| 18 |
|
| 19 |
-
*Remarks:* This member operator template (and therefore `locale` itself)
|
| 20 |
-
meets the requirements for a comparator predicate template
|
| 21 |
-
argument [[algorithms]] applied to strings.
|
| 22 |
-
|
| 23 |
*Returns:*
|
| 24 |
|
| 25 |
``` cpp
|
| 26 |
use_facet<collate<charT>>(*this).compare(s1.data(), s1.data() + s1.size(),
|
| 27 |
s2.data(), s2.data() + s2.size()) < 0
|
| 28 |
```
|
| 29 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
[*Example 1*:
|
| 31 |
|
| 32 |
A vector of strings `v` can be collated according to collation rules in
|
| 33 |
-
locale `loc` simply by
|
| 34 |
|
| 35 |
``` cpp
|
| 36 |
std::sort(v.begin(), v.end(), loc);
|
| 37 |
```
|
| 38 |
|
|
|
|
| 14 |
const basic_string<charT, traits, Allocator>& s2) const;
|
| 15 |
```
|
| 16 |
|
| 17 |
*Effects:* Compares two strings according to the `collate<charT>` facet.
|
| 18 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
*Returns:*
|
| 20 |
|
| 21 |
``` cpp
|
| 22 |
use_facet<collate<charT>>(*this).compare(s1.data(), s1.data() + s1.size(),
|
| 23 |
s2.data(), s2.data() + s2.size()) < 0
|
| 24 |
```
|
| 25 |
|
| 26 |
+
*Remarks:* This member operator template (and therefore `locale` itself)
|
| 27 |
+
meets the requirements for a comparator predicate template
|
| 28 |
+
argument [[algorithms]] applied to strings.
|
| 29 |
+
|
| 30 |
[*Example 1*:
|
| 31 |
|
| 32 |
A vector of strings `v` can be collated according to collation rules in
|
| 33 |
+
locale `loc` simply by [[alg.sort]], [[vector]]:
|
| 34 |
|
| 35 |
``` cpp
|
| 36 |
std::sort(v.begin(), v.end(), loc);
|
| 37 |
```
|
| 38 |
|