tmp/tmpjyn_7ytc/{from.md → to.md}
RENAMED
|
@@ -1,19 +1,21 @@
|
|
| 1 |
## Class template `match_results` <a id="re.results">[[re.results]]</a>
|
| 2 |
|
|
|
|
|
|
|
| 3 |
Class template `match_results` denotes a collection of character
|
| 4 |
sequences representing the result of a regular expression match. Storage
|
| 5 |
for the collection is allocated and freed as necessary by the member
|
| 6 |
functions of class template `match_results`.
|
| 7 |
|
| 8 |
The class template `match_results` meets the requirements of an
|
| 9 |
-
allocator-aware container and of a sequence container
|
| 10 |
-
[[container.requirements.general]], [[sequence.reqmts]]
|
| 11 |
-
|
| 12 |
const-qualified sequence containers are supported and that the semantics
|
| 13 |
-
of comparison functions are different from those required
|
| 14 |
-
container.
|
| 15 |
|
| 16 |
A default-constructed `match_results` object has no fully established
|
| 17 |
result state. A match result is *ready* when, as a consequence of a
|
| 18 |
completed regular expression match modifying such an object, its result
|
| 19 |
state becomes fully established. The effects of calling most member
|
|
@@ -40,11 +42,11 @@ namespace std {
|
|
| 40 |
class match_results {
|
| 41 |
public:
|
| 42 |
using value_type = sub_match<BidirectionalIterator>;
|
| 43 |
using const_reference = const value_type&;
|
| 44 |
using reference = value_type&;
|
| 45 |
-
using const_iterator =
|
| 46 |
using iterator = const_iterator;
|
| 47 |
using difference_type =
|
| 48 |
typename iterator_traits<BidirectionalIterator>::difference_type;
|
| 49 |
using size_type = typename allocator_traits<Allocator>::size_type;
|
| 50 |
using allocator_type = Allocator;
|
|
@@ -52,13 +54,15 @@ namespace std {
|
|
| 52 |
typename iterator_traits<BidirectionalIterator>::value_type;
|
| 53 |
using string_type = basic_string<char_type>;
|
| 54 |
|
| 55 |
// [re.results.const], construct/copy/destroy
|
| 56 |
match_results() : match_results(Allocator()) {}
|
| 57 |
-
explicit match_results(const Allocator&);
|
| 58 |
match_results(const match_results& m);
|
|
|
|
| 59 |
match_results(match_results&& m) noexcept;
|
|
|
|
| 60 |
match_results& operator=(const match_results& m);
|
| 61 |
match_results& operator=(match_results&& m);
|
| 62 |
~match_results();
|
| 63 |
|
| 64 |
// [re.results.state], state
|
|
@@ -110,25 +114,48 @@ namespace std {
|
|
| 110 |
}
|
| 111 |
```
|
| 112 |
|
| 113 |
### Constructors <a id="re.results.const">[[re.results.const]]</a>
|
| 114 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 115 |
``` cpp
|
| 116 |
explicit match_results(const Allocator& a);
|
| 117 |
```
|
| 118 |
|
|
|
|
|
|
|
| 119 |
*Ensures:* `ready()` returns `false`. `size()` returns `0`.
|
| 120 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 121 |
``` cpp
|
| 122 |
match_results(match_results&& m) noexcept;
|
|
|
|
| 123 |
```
|
| 124 |
|
| 125 |
-
*Effects:*
|
| 126 |
-
`m.get_allocator()`.
|
|
|
|
| 127 |
|
| 128 |
*Ensures:* As specified in [[re.results.const]].
|
| 129 |
|
|
|
|
|
|
|
|
|
|
| 130 |
``` cpp
|
| 131 |
match_results& operator=(const match_results& m);
|
| 132 |
```
|
| 133 |
|
| 134 |
*Ensures:* As specified in [[re.results.const]].
|
|
@@ -137,22 +164,22 @@ match_results& operator=(const match_results& m);
|
|
| 137 |
match_results& operator=(match_results&& m);
|
| 138 |
```
|
| 139 |
|
| 140 |
*Ensures:* As specified in [[re.results.const]].
|
| 141 |
|
| 142 |
-
**Table: `match_results`
|
| 143 |
|
| 144 |
| Element | Value |
|
| 145 |
-
| ------------- | ----------------------------------------------- |
|
| 146 |
| `ready()` | `m.ready()` |
|
| 147 |
| `size()` | `m.size()` |
|
| 148 |
-
| `str(n)` | `m.str(n)` for all integers `n < m.size()` |
|
| 149 |
| `prefix()` | `m.prefix()` |
|
| 150 |
| `suffix()` | `m.suffix()` |
|
| 151 |
-
| `(*this)[n]` | `m[n]` for all integers `n < m.size()` |
|
| 152 |
-
| `length(n)` | `m.length(n)` for all integers `n < m.size()` |
|
| 153 |
-
| `position(n)` | `m.position(n)` for all integers `n < m.size()` |
|
| 154 |
|
| 155 |
|
| 156 |
### State <a id="re.results.state">[[re.results.state]]</a>
|
| 157 |
|
| 158 |
``` cpp
|
|
|
|
| 1 |
## Class template `match_results` <a id="re.results">[[re.results]]</a>
|
| 2 |
|
| 3 |
+
### General <a id="re.results.general">[[re.results.general]]</a>
|
| 4 |
+
|
| 5 |
Class template `match_results` denotes a collection of character
|
| 6 |
sequences representing the result of a regular expression match. Storage
|
| 7 |
for the collection is allocated and freed as necessary by the member
|
| 8 |
functions of class template `match_results`.
|
| 9 |
|
| 10 |
The class template `match_results` meets the requirements of an
|
| 11 |
+
allocator-aware container and of a sequence container
|
| 12 |
+
[[container.requirements.general]], [[sequence.reqmts]] except that only
|
| 13 |
+
copy assignment, move assignment, and operations defined for
|
| 14 |
const-qualified sequence containers are supported and that the semantics
|
| 15 |
+
of the comparison operator functions are different from those required
|
| 16 |
+
for a container.
|
| 17 |
|
| 18 |
A default-constructed `match_results` object has no fully established
|
| 19 |
result state. A match result is *ready* when, as a consequence of a
|
| 20 |
completed regular expression match modifying such an object, its result
|
| 21 |
state becomes fully established. The effects of calling most member
|
|
|
|
| 42 |
class match_results {
|
| 43 |
public:
|
| 44 |
using value_type = sub_match<BidirectionalIterator>;
|
| 45 |
using const_reference = const value_type&;
|
| 46 |
using reference = value_type&;
|
| 47 |
+
using const_iterator = implementation-defined // type of match_results::const_iterator;
|
| 48 |
using iterator = const_iterator;
|
| 49 |
using difference_type =
|
| 50 |
typename iterator_traits<BidirectionalIterator>::difference_type;
|
| 51 |
using size_type = typename allocator_traits<Allocator>::size_type;
|
| 52 |
using allocator_type = Allocator;
|
|
|
|
| 54 |
typename iterator_traits<BidirectionalIterator>::value_type;
|
| 55 |
using string_type = basic_string<char_type>;
|
| 56 |
|
| 57 |
// [re.results.const], construct/copy/destroy
|
| 58 |
match_results() : match_results(Allocator()) {}
|
| 59 |
+
explicit match_results(const Allocator& a);
|
| 60 |
match_results(const match_results& m);
|
| 61 |
+
match_results(const match_results& m, const Allocator& a);
|
| 62 |
match_results(match_results&& m) noexcept;
|
| 63 |
+
match_results(match_results&& m, const Allocator& a);
|
| 64 |
match_results& operator=(const match_results& m);
|
| 65 |
match_results& operator=(match_results&& m);
|
| 66 |
~match_results();
|
| 67 |
|
| 68 |
// [re.results.state], state
|
|
|
|
| 114 |
}
|
| 115 |
```
|
| 116 |
|
| 117 |
### Constructors <a id="re.results.const">[[re.results.const]]</a>
|
| 118 |
|
| 119 |
+
[[re.results.const]] lists the postconditions of `match_results`
|
| 120 |
+
copy/move constructors and copy/move assignment operators. For move
|
| 121 |
+
operations, the results of the expressions depending on the parameter
|
| 122 |
+
`m` denote the values they had before the respective function calls.
|
| 123 |
+
|
| 124 |
``` cpp
|
| 125 |
explicit match_results(const Allocator& a);
|
| 126 |
```
|
| 127 |
|
| 128 |
+
*Effects:* The stored `Allocator` value is constructed from `a`.
|
| 129 |
+
|
| 130 |
*Ensures:* `ready()` returns `false`. `size()` returns `0`.
|
| 131 |
|
| 132 |
+
``` cpp
|
| 133 |
+
match_results(const match_results& m);
|
| 134 |
+
match_results(const match_results& m, const Allocator& a);
|
| 135 |
+
```
|
| 136 |
+
|
| 137 |
+
*Effects:* For the first form, the stored `Allocator` value is obtained
|
| 138 |
+
as specified in [[container.reqmts]]. For the second form, the stored
|
| 139 |
+
`Allocator` value is constructed from `a`.
|
| 140 |
+
|
| 141 |
+
*Ensures:* As specified in [[re.results.const]].
|
| 142 |
+
|
| 143 |
``` cpp
|
| 144 |
match_results(match_results&& m) noexcept;
|
| 145 |
+
match_results(match_results&& m, const Allocator& a);
|
| 146 |
```
|
| 147 |
|
| 148 |
+
*Effects:* For the first form, the stored `Allocator` value is move
|
| 149 |
+
constructed from `m.get_allocator()`. For the second form, the stored
|
| 150 |
+
`Allocator` value is constructed from `a`.
|
| 151 |
|
| 152 |
*Ensures:* As specified in [[re.results.const]].
|
| 153 |
|
| 154 |
+
*Throws:* The second form throws nothing if `a == m.get_allocator()` is
|
| 155 |
+
`true`.
|
| 156 |
+
|
| 157 |
``` cpp
|
| 158 |
match_results& operator=(const match_results& m);
|
| 159 |
```
|
| 160 |
|
| 161 |
*Ensures:* As specified in [[re.results.const]].
|
|
|
|
| 164 |
match_results& operator=(match_results&& m);
|
| 165 |
```
|
| 166 |
|
| 167 |
*Ensures:* As specified in [[re.results.const]].
|
| 168 |
|
| 169 |
+
**Table: `match_results` copy/move operation postconditions** <a id="re.results.const">[re.results.const]</a>
|
| 170 |
|
| 171 |
| Element | Value |
|
| 172 |
+
| ------------- | ------------------------------------------------------------ |
|
| 173 |
| `ready()` | `m.ready()` |
|
| 174 |
| `size()` | `m.size()` |
|
| 175 |
+
| `str(n)` | `m.str(n)` for all non-negative integers `n < m.size()` |
|
| 176 |
| `prefix()` | `m.prefix()` |
|
| 177 |
| `suffix()` | `m.suffix()` |
|
| 178 |
+
| `(*this)[n]` | `m[n]` for all non-negative integers `n < m.size()` |
|
| 179 |
+
| `length(n)` | `m.length(n)` for all non-negative integers `n < m.size()` |
|
| 180 |
+
| `position(n)` | `m.position(n)` for all non-negative integers `n < m.size()` |
|
| 181 |
|
| 182 |
|
| 183 |
### State <a id="re.results.state">[[re.results.state]]</a>
|
| 184 |
|
| 185 |
``` cpp
|