From Jason Turner

[re.iter]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpphedys4q/{from.md → to.md} +17 -33
tmp/tmpphedys4q/{from.md → to.md} RENAMED
@@ -45,11 +45,10 @@ 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
- bool operator!=(const regex_iterator&) const;
51
  const value_type& operator*() const;
52
  const value_type* operator->() const;
53
  regex_iterator& operator++();
54
  regex_iterator operator++(int);
55
 
@@ -69,11 +68,11 @@ iterator holds a *zero-length match* if `match[0].matched == true` and
69
 
70
  [*Note 1*: For example, this can occur when the part of the regular
71
  expression that matched consists only of an assertion (such as `'^'`,
72
  `'$'`, `'\b'`, `'\B'`). — *end note*]
73
 
74
- #### `regex_iterator` constructors <a id="re.regiter.cnstr">[[re.regiter.cnstr]]</a>
75
 
76
  ``` cpp
77
  regex_iterator();
78
  ```
79
 
@@ -84,15 +83,15 @@ regex_iterator(BidirectionalIterator a, BidirectionalIterator b,
84
  const regex_type& re,
85
  regex_constants::match_flag_type m = regex_constants::match_default);
86
  ```
87
 
88
  *Effects:* Initializes `begin` and `end` to `a` and `b`, respectively,
89
- sets `pregex` to `&re`, sets `flags` to `m`, then calls
90
  `regex_search(begin, end, match, *pregex, flags)`. If this call returns
91
  `false` the constructor sets `*this` to the end-of-sequence iterator.
92
 
93
- #### `regex_iterator` comparisons <a id="re.regiter.comp">[[re.regiter.comp]]</a>
94
 
95
  ``` cpp
96
  bool operator==(const regex_iterator& right) const;
97
  ```
98
 
@@ -105,17 +104,11 @@ iterators or if the following conditions all hold:
105
  - `flags == right.flags`, and
106
  - `match[0] == right.match[0]`;
107
 
108
  otherwise `false`.
109
 
110
- ``` cpp
111
- bool operator!=(const regex_iterator& right) const;
112
- ```
113
-
114
- *Returns:* `!(*this == right)`.
115
-
116
- #### `regex_iterator` indirection <a id="re.regiter.deref">[[re.regiter.deref]]</a>
117
 
118
  ``` cpp
119
  const value_type& operator*() const;
120
  ```
121
 
@@ -123,13 +116,13 @@ const value_type& operator*() const;
123
 
124
  ``` cpp
125
  const value_type* operator->() const;
126
  ```
127
 
128
- *Returns:* `&match`.
129
 
130
- #### `regex_iterator` increment <a id="re.regiter.incr">[[re.regiter.incr]]</a>
131
 
132
  ``` cpp
133
  regex_iterator& operator++();
134
  ```
135
 
@@ -171,11 +164,11 @@ offset from the sequence passed in the call to
171
  `regex_search`. — *end note*]
172
 
173
  It is unspecified how the implementation makes these adjustments.
174
 
175
  [*Note 2*: This means that a compiler may call an
176
- implementation-specific search function, in which case a user-defined
177
  specialization of `regex_search` will not be called. — *end note*]
178
 
179
  ``` cpp
180
  regex_iterator operator++(int);
181
  ```
@@ -291,11 +284,10 @@ namespace std {
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!=(const regex_token_iterator&) const;
297
  const value_type& operator*() const;
298
  const value_type* operator->() const;
299
  regex_token_iterator& operator++();
300
  regex_token_iterator operator++(int);
301
 
@@ -318,16 +310,16 @@ suffix iterator the member `result` holds a pointer to the data member
318
  `suffix.first` points to the beginning of the final sequence, and
319
  `suffix.second` points to the end of the final sequence.
320
 
321
  [*Note 1*: For a suffix iterator, data member `suffix.first` is the
322
  same as the end of the last match found, and `suffix.second` is the same
323
- as the end of the target sequence — *end note*]
324
 
325
  The *current match* is `(*position).prefix()` if `subs[N] == -1`, or
326
  `(*position)[subs[N]]` for any other value of `subs[N]`.
327
 
328
- #### `regex_token_iterator` constructors <a id="re.tokiter.cnstr">[[re.tokiter.cnstr]]</a>
329
 
330
  ``` cpp
331
  regex_token_iterator();
332
  ```
333
 
@@ -354,30 +346,28 @@ template <size_t N>
354
  const regex_type& re,
355
  const int (&submatches)[N],
356
  regex_constants::match_flag_type m = regex_constants::match_default);
357
  ```
358
 
359
- *Requires:* Each of the initialization values of `submatches` shall be
360
  `>= -1`.
361
 
362
  *Effects:* The first constructor initializes the member `subs` to hold
363
- the single value `submatch`. The second constructor initializes the
364
- member `subs` to hold a copy of the argument `submatches`. The third and
365
- fourth constructors initialize the member `subs` to hold a copy of the
366
- sequence of integer values pointed to by the iterator range
367
- \[`submatches.begin()`, `submatches.end()`) and \[`&submatches`,
368
- `&submatches + N`), respectively.
369
 
370
  Each constructor then sets `N` to 0, and `position` to
371
  `position_iterator(a, b, re, m)`. If `position` is not an
372
  end-of-sequence iterator the constructor sets `result` to the address of
373
  the current match. Otherwise if any of the values stored in `subs` is
374
  equal to -1 the constructor sets `*this` to a suffix iterator that
375
  points to the range \[`a`, `b`), otherwise the constructor sets `*this`
376
  to an end-of-sequence iterator.
377
 
378
- #### `regex_token_iterator` comparisons <a id="re.tokiter.comp">[[re.tokiter.comp]]</a>
379
 
380
  ``` cpp
381
  bool operator==(const regex_token_iterator& right) const;
382
  ```
383
 
@@ -386,17 +376,11 @@ iterators, or if `*this` and `right` are both suffix iterators and
386
  `suffix == right.suffix`; otherwise returns `false` if `*this` or
387
  `right` is an end-of-sequence iterator or a suffix iterator. Otherwise
388
  returns `true` if `position == right.position`, `N == right.N`, and
389
  `subs == right.subs`. Otherwise returns `false`.
390
 
391
- ``` cpp
392
- bool operator!=(const regex_token_iterator& right) const;
393
- ```
394
-
395
- *Returns:* `!(*this == right)`.
396
-
397
- #### `regex_token_iterator` indirection <a id="re.tokiter.deref">[[re.tokiter.deref]]</a>
398
 
399
  ``` cpp
400
  const value_type& operator*() const;
401
  ```
402
 
@@ -406,11 +390,11 @@ const value_type& operator*() const;
406
  const value_type* operator->() const;
407
  ```
408
 
409
  *Returns:* `result`.
410
 
411
- #### `regex_token_iterator` increment <a id="re.tokiter.incr">[[re.tokiter.incr]]</a>
412
 
413
  ``` cpp
414
  regex_token_iterator& operator++();
415
  ```
416
 
 
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
 
 
68
 
69
  [*Note 1*: For example, this can occur when the part of the regular
70
  expression that matched consists only of an assertion (such as `'^'`,
71
  `'$'`, `'\b'`, `'\B'`). — *end note*]
72
 
73
+ #### Constructors <a id="re.regiter.cnstr">[[re.regiter.cnstr]]</a>
74
 
75
  ``` cpp
76
  regex_iterator();
77
  ```
78
 
 
83
  const regex_type& re,
84
  regex_constants::match_flag_type m = regex_constants::match_default);
85
  ```
86
 
87
  *Effects:* Initializes `begin` and `end` to `a` and `b`, respectively,
88
+ sets `pregex` to `addressof(re)`, sets `flags` to `m`, then calls
89
  `regex_search(begin, end, match, *pregex, flags)`. If this call returns
90
  `false` the constructor sets `*this` to the end-of-sequence iterator.
91
 
92
+ #### Comparisons <a id="re.regiter.comp">[[re.regiter.comp]]</a>
93
 
94
  ``` cpp
95
  bool operator==(const regex_iterator& right) const;
96
  ```
97
 
 
104
  - `flags == right.flags`, and
105
  - `match[0] == right.match[0]`;
106
 
107
  otherwise `false`.
108
 
109
+ #### Indirection <a id="re.regiter.deref">[[re.regiter.deref]]</a>
 
 
 
 
 
 
110
 
111
  ``` cpp
112
  const value_type& operator*() const;
113
  ```
114
 
 
116
 
117
  ``` cpp
118
  const value_type* operator->() const;
119
  ```
120
 
121
+ *Returns:* `addressof(match)`.
122
 
123
+ #### Increment <a id="re.regiter.incr">[[re.regiter.incr]]</a>
124
 
125
  ``` cpp
126
  regex_iterator& operator++();
127
  ```
128
 
 
164
  `regex_search`. — *end note*]
165
 
166
  It is unspecified how the implementation makes these adjustments.
167
 
168
  [*Note 2*: This means that a compiler may call an
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);
174
  ```
 
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
 
 
310
  `suffix.first` points to the beginning of the final sequence, and
311
  `suffix.second` points to the end of the final sequence.
312
 
313
  [*Note 1*: For a suffix iterator, data member `suffix.first` is the
314
  same as the end of the last match found, and `suffix.second` is the same
315
+ as the end of the target sequence. — *end note*]
316
 
317
  The *current match* is `(*position).prefix()` if `subs[N] == -1`, or
318
  `(*position)[subs[N]]` for any other value of `subs[N]`.
319
 
320
+ #### Constructors <a id="re.tokiter.cnstr">[[re.tokiter.cnstr]]</a>
321
 
322
  ``` cpp
323
  regex_token_iterator();
324
  ```
325
 
 
346
  const regex_type& re,
347
  const int (&submatches)[N],
348
  regex_constants::match_flag_type m = regex_constants::match_default);
349
  ```
350
 
351
+ *Preconditions:* Each of the initialization values of `submatches` is
352
  `>= -1`.
353
 
354
  *Effects:* The first constructor initializes the member `subs` to hold
355
+ the single value `submatch`. The second, third, and fourth constructors
356
+ initialize the member `subs` to hold a copy of the sequence of integer
357
+ values pointed to by the iterator range \[`begin(submatches)`,
358
+ `end(submatches)`).
 
 
359
 
360
  Each constructor then sets `N` to 0, and `position` to
361
  `position_iterator(a, b, re, m)`. If `position` is not an
362
  end-of-sequence iterator the constructor sets `result` to the address of
363
  the current match. Otherwise if any of the values stored in `subs` is
364
  equal to -1 the constructor sets `*this` to a suffix iterator that
365
  points to the range \[`a`, `b`), otherwise the constructor sets `*this`
366
  to an end-of-sequence iterator.
367
 
368
+ #### Comparisons <a id="re.tokiter.comp">[[re.tokiter.comp]]</a>
369
 
370
  ``` cpp
371
  bool operator==(const regex_token_iterator& right) const;
372
  ```
373
 
 
376
  `suffix == right.suffix`; otherwise returns `false` if `*this` or
377
  `right` is an end-of-sequence iterator or a suffix iterator. Otherwise
378
  returns `true` if `position == right.position`, `N == right.N`, and
379
  `subs == right.subs`. Otherwise returns `false`.
380
 
381
+ #### Indirection <a id="re.tokiter.deref">[[re.tokiter.deref]]</a>
 
 
 
 
 
 
382
 
383
  ``` cpp
384
  const value_type& operator*() const;
385
  ```
386
 
 
390
  const value_type* operator->() const;
391
  ```
392
 
393
  *Returns:* `result`.
394
 
395
+ #### Increment <a id="re.tokiter.incr">[[re.tokiter.incr]]</a>
396
 
397
  ``` cpp
398
  regex_token_iterator& operator++();
399
  ```
400