tmp/tmpun83j84z/{from.md → to.md}
RENAMED
|
@@ -1,9 +1,11 @@
|
|
| 1 |
## Regular expression iterators <a id="re.iter">[[re.iter]]</a>
|
| 2 |
|
| 3 |
### Class template `regex_iterator` <a id="re.regiter">[[re.regiter]]</a>
|
| 4 |
|
|
|
|
|
|
|
| 5 |
The class template `regex_iterator` is an iterator adaptor. It
|
| 6 |
represents a new view of an existing iterator sequence, by enumerating
|
| 7 |
all the occurrences of a regular expression within that sequence. A
|
| 8 |
`regex_iterator` uses `regex_search` to find successive regular
|
| 9 |
expression matches within the sequence from which it was constructed.
|
|
@@ -30,10 +32,11 @@ namespace std {
|
|
| 30 |
class traits = regex_traits<charT>>
|
| 31 |
class regex_iterator {
|
| 32 |
public:
|
| 33 |
using regex_type = basic_regex<charT, traits>;
|
| 34 |
using iterator_category = forward_iterator_tag;
|
|
|
|
| 35 |
using value_type = match_results<BidirectionalIterator>;
|
| 36 |
using difference_type = ptrdiff_t;
|
| 37 |
using pointer = const value_type*;
|
| 38 |
using reference = const value_type&;
|
| 39 |
|
|
@@ -45,10 +48,11 @@ namespace std {
|
|
| 45 |
const regex_type&&,
|
| 46 |
regex_constants::match_flag_type = regex_constants::match_default) = delete;
|
| 47 |
regex_iterator(const regex_iterator&);
|
| 48 |
regex_iterator& operator=(const regex_iterator&);
|
| 49 |
bool operator==(const regex_iterator&) const;
|
|
|
|
| 50 |
const value_type& operator*() const;
|
| 51 |
const value_type* operator->() const;
|
| 52 |
regex_iterator& operator++();
|
| 53 |
regex_iterator operator++(int);
|
| 54 |
|
|
@@ -163,11 +167,11 @@ the beginning of the target sequence, which is often not the same as the
|
|
| 163 |
offset from the sequence passed in the call to
|
| 164 |
`regex_search`. — *end note*]
|
| 165 |
|
| 166 |
It is unspecified how the implementation makes these adjustments.
|
| 167 |
|
| 168 |
-
[*Note 2*: This means that
|
| 169 |
implementation-specific search function, in which case a program-defined
|
| 170 |
specialization of `regex_search` will not be called. — *end note*]
|
| 171 |
|
| 172 |
``` cpp
|
| 173 |
regex_iterator operator++(int);
|
|
@@ -181,10 +185,12 @@ regex_iterator tmp = *this;
|
|
| 181 |
return tmp;
|
| 182 |
```
|
| 183 |
|
| 184 |
### Class template `regex_token_iterator` <a id="re.tokiter">[[re.tokiter]]</a>
|
| 185 |
|
|
|
|
|
|
|
| 186 |
The class template `regex_token_iterator` is an iterator adaptor; that
|
| 187 |
is to say it represents a new view of an existing iterator sequence, by
|
| 188 |
enumerating all the occurrences of a regular expression within that
|
| 189 |
sequence, and presenting one or more sub-expressions for each match
|
| 190 |
found. Each position enumerated by the iterator is a `sub_match` class
|
|
@@ -233,10 +239,11 @@ namespace std {
|
|
| 233 |
class traits = regex_traits<charT>>
|
| 234 |
class regex_token_iterator {
|
| 235 |
public:
|
| 236 |
using regex_type = basic_regex<charT, traits>;
|
| 237 |
using iterator_category = forward_iterator_tag;
|
|
|
|
| 238 |
using value_type = sub_match<BidirectionalIterator>;
|
| 239 |
using difference_type = ptrdiff_t;
|
| 240 |
using pointer = const value_type*;
|
| 241 |
using reference = const value_type&;
|
| 242 |
|
|
@@ -284,10 +291,11 @@ namespace std {
|
|
| 284 |
regex_constants::match_flag_type m =
|
| 285 |
regex_constants::match_default) = delete;
|
| 286 |
regex_token_iterator(const regex_token_iterator&);
|
| 287 |
regex_token_iterator& operator=(const regex_token_iterator&);
|
| 288 |
bool operator==(const regex_token_iterator&) const;
|
|
|
|
| 289 |
const value_type& operator*() const;
|
| 290 |
const value_type* operator->() const;
|
| 291 |
regex_token_iterator& operator++();
|
| 292 |
regex_token_iterator operator++(int);
|
| 293 |
|
|
|
|
| 1 |
## Regular expression iterators <a id="re.iter">[[re.iter]]</a>
|
| 2 |
|
| 3 |
### Class template `regex_iterator` <a id="re.regiter">[[re.regiter]]</a>
|
| 4 |
|
| 5 |
+
#### General <a id="re.regiter.general">[[re.regiter.general]]</a>
|
| 6 |
+
|
| 7 |
The class template `regex_iterator` is an iterator adaptor. It
|
| 8 |
represents a new view of an existing iterator sequence, by enumerating
|
| 9 |
all the occurrences of a regular expression within that sequence. A
|
| 10 |
`regex_iterator` uses `regex_search` to find successive regular
|
| 11 |
expression matches within the sequence from which it was constructed.
|
|
|
|
| 32 |
class traits = regex_traits<charT>>
|
| 33 |
class regex_iterator {
|
| 34 |
public:
|
| 35 |
using regex_type = basic_regex<charT, traits>;
|
| 36 |
using iterator_category = forward_iterator_tag;
|
| 37 |
+
using iterator_concept = input_iterator_tag;
|
| 38 |
using value_type = match_results<BidirectionalIterator>;
|
| 39 |
using difference_type = ptrdiff_t;
|
| 40 |
using pointer = const value_type*;
|
| 41 |
using reference = const value_type&;
|
| 42 |
|
|
|
|
| 48 |
const regex_type&&,
|
| 49 |
regex_constants::match_flag_type = regex_constants::match_default) = delete;
|
| 50 |
regex_iterator(const regex_iterator&);
|
| 51 |
regex_iterator& operator=(const regex_iterator&);
|
| 52 |
bool operator==(const regex_iterator&) const;
|
| 53 |
+
bool operator==(default_sentinel_t) const { return *this == regex_iterator(); }
|
| 54 |
const value_type& operator*() const;
|
| 55 |
const value_type* operator->() const;
|
| 56 |
regex_iterator& operator++();
|
| 57 |
regex_iterator operator++(int);
|
| 58 |
|
|
|
|
| 167 |
offset from the sequence passed in the call to
|
| 168 |
`regex_search`. — *end note*]
|
| 169 |
|
| 170 |
It is unspecified how the implementation makes these adjustments.
|
| 171 |
|
| 172 |
+
[*Note 2*: This means that an implementation can call an
|
| 173 |
implementation-specific search function, in which case a program-defined
|
| 174 |
specialization of `regex_search` will not be called. — *end note*]
|
| 175 |
|
| 176 |
``` cpp
|
| 177 |
regex_iterator operator++(int);
|
|
|
|
| 185 |
return tmp;
|
| 186 |
```
|
| 187 |
|
| 188 |
### Class template `regex_token_iterator` <a id="re.tokiter">[[re.tokiter]]</a>
|
| 189 |
|
| 190 |
+
#### General <a id="re.tokiter.general">[[re.tokiter.general]]</a>
|
| 191 |
+
|
| 192 |
The class template `regex_token_iterator` is an iterator adaptor; that
|
| 193 |
is to say it represents a new view of an existing iterator sequence, by
|
| 194 |
enumerating all the occurrences of a regular expression within that
|
| 195 |
sequence, and presenting one or more sub-expressions for each match
|
| 196 |
found. Each position enumerated by the iterator is a `sub_match` class
|
|
|
|
| 239 |
class traits = regex_traits<charT>>
|
| 240 |
class regex_token_iterator {
|
| 241 |
public:
|
| 242 |
using regex_type = basic_regex<charT, traits>;
|
| 243 |
using iterator_category = forward_iterator_tag;
|
| 244 |
+
using iterator_concept = input_iterator_tag;
|
| 245 |
using value_type = sub_match<BidirectionalIterator>;
|
| 246 |
using difference_type = ptrdiff_t;
|
| 247 |
using pointer = const value_type*;
|
| 248 |
using reference = const value_type&;
|
| 249 |
|
|
|
|
| 291 |
regex_constants::match_flag_type m =
|
| 292 |
regex_constants::match_default) = delete;
|
| 293 |
regex_token_iterator(const regex_token_iterator&);
|
| 294 |
regex_token_iterator& operator=(const regex_token_iterator&);
|
| 295 |
bool operator==(const regex_token_iterator&) const;
|
| 296 |
+
bool operator==(default_sentinel_t) const { return *this == regex_token_iterator(); }
|
| 297 |
const value_type& operator*() const;
|
| 298 |
const value_type* operator->() const;
|
| 299 |
regex_token_iterator& operator++();
|
| 300 |
regex_token_iterator operator++(int);
|
| 301 |
|