tmp/tmpzc32pt8n/{from.md → to.md}
RENAMED
|
@@ -10,11 +10,11 @@ copy of the other, or each has a name and the names are identical;
|
|
| 10 |
|
| 11 |
``` cpp
|
| 12 |
bool operator!=(const locale& other) const;
|
| 13 |
```
|
| 14 |
|
| 15 |
-
*Returns:*
|
| 16 |
|
| 17 |
``` cpp
|
| 18 |
template <class charT, class traits, class Allocator>
|
| 19 |
bool operator()(const basic_string<charT, traits, Allocator>& s1,
|
| 20 |
const basic_string<charT, traits, Allocator>& s2) const;
|
|
@@ -24,19 +24,23 @@ template <class charT, class traits, class Allocator>
|
|
| 24 |
|
| 25 |
*Remarks:* This member operator template (and therefore `locale` itself)
|
| 26 |
satisfies requirements for a comparator predicate template argument
|
| 27 |
(Clause [[algorithms]]) applied to strings.
|
| 28 |
|
| 29 |
-
*Returns:*
|
| 30 |
|
| 31 |
``` cpp
|
| 32 |
-
use_facet<
|
| 33 |
-
|
| 34 |
```
|
| 35 |
|
|
|
|
|
|
|
| 36 |
A vector of strings `v` can be collated according to collation rules in
|
| 37 |
locale `loc` simply by ([[alg.sort]], [[vector]]):
|
| 38 |
|
| 39 |
``` cpp
|
| 40 |
std::sort(v.begin(), v.end(), loc);
|
| 41 |
```
|
| 42 |
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
``` cpp
|
| 12 |
bool operator!=(const locale& other) const;
|
| 13 |
```
|
| 14 |
|
| 15 |
+
*Returns:* `!(*this == other)`.
|
| 16 |
|
| 17 |
``` cpp
|
| 18 |
template <class charT, class traits, class Allocator>
|
| 19 |
bool operator()(const basic_string<charT, traits, Allocator>& s1,
|
| 20 |
const basic_string<charT, traits, Allocator>& s2) const;
|
|
|
|
| 24 |
|
| 25 |
*Remarks:* This member operator template (and therefore `locale` itself)
|
| 26 |
satisfies requirements for a comparator predicate template argument
|
| 27 |
(Clause [[algorithms]]) applied to strings.
|
| 28 |
|
| 29 |
+
*Returns:*
|
| 30 |
|
| 31 |
``` cpp
|
| 32 |
+
use_facet<collate<charT>>(*this).compare(s1.data(), s1.data() + s1.size(),
|
| 33 |
+
s2.data(), s2.data() + s2.size()) < 0
|
| 34 |
```
|
| 35 |
|
| 36 |
+
[*Example 1*:
|
| 37 |
+
|
| 38 |
A vector of strings `v` can be collated according to collation rules in
|
| 39 |
locale `loc` simply by ([[alg.sort]], [[vector]]):
|
| 40 |
|
| 41 |
``` cpp
|
| 42 |
std::sort(v.begin(), v.end(), loc);
|
| 43 |
```
|
| 44 |
|
| 45 |
+
— *end example*]
|
| 46 |
+
|