From Jason Turner

[re.results]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpjn6v2jsh/{from.md → to.md} +19 -21
tmp/tmpjn6v2jsh/{from.md → to.md} RENAMED
@@ -1,18 +1,18 @@
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
@@ -44,16 +44,14 @@ namespace std {
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;
53
- using char_type =
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);
@@ -69,11 +67,11 @@ namespace std {
69
  bool ready() const;
70
 
71
  // [re.results.size], size
72
  size_type size() const;
73
  size_type max_size() const;
74
- [[nodiscard]] bool empty() const;
75
 
76
  // [re.results.acc], element access
77
  difference_type length(size_type sub = 0) const;
78
  difference_type position(size_type sub = 0) const;
79
  string_type str(size_type sub = 0) const;
@@ -112,11 +110,11 @@ namespace std {
112
  void swap(match_results& that);
113
  };
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.
@@ -178,20 +176,20 @@ match_results& operator=(match_results&& m);
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
186
  bool ready() const;
187
  ```
188
 
189
  *Returns:* `true` if `*this` has a fully established result state,
190
  otherwise `false`.
191
 
192
- ### Size <a id="re.results.size">[[re.results.size]]</a>
193
 
194
  ``` cpp
195
  size_type size() const;
196
  ```
197
 
@@ -210,16 +208,16 @@ size_type max_size() const;
210
 
211
  *Returns:* The maximum number of `sub_match` elements that can be stored
212
  in `*this`.
213
 
214
  ``` cpp
215
- [[nodiscard]] bool empty() const;
216
  ```
217
 
218
  *Returns:* `size() == 0`.
219
 
220
- ### Element access <a id="re.results.acc">[[re.results.acc]]</a>
221
 
222
  ``` cpp
223
  difference_type length(size_type sub = 0) const;
224
  ```
225
 
@@ -291,11 +289,11 @@ const_iterator cend() const;
291
  ```
292
 
293
  *Returns:* A terminating iterator that enumerates over all the
294
  sub-expressions stored in `*this`.
295
 
296
- ### Formatting <a id="re.results.form">[[re.results.form]]</a>
297
 
298
  ``` cpp
299
  template<class OutputIter>
300
  OutputIter format(
301
  OutputIter out,
@@ -362,21 +360,21 @@ calls:
362
  format(back_inserter(result), fmt, fmt + char_traits<char_type>::length(fmt), flags);
363
  ```
364
 
365
  *Returns:* `result`.
366
 
367
- ### Allocator <a id="re.results.all">[[re.results.all]]</a>
368
 
369
  ``` cpp
370
  allocator_type get_allocator() const;
371
  ```
372
 
373
  *Returns:* A copy of the Allocator that was passed to the object’s
374
  constructor or, if that allocator has been replaced, a copy of the most
375
  recent replacement.
376
 
377
- ### Swap <a id="re.results.swap">[[re.results.swap]]</a>
378
 
379
  ``` cpp
380
  void swap(match_results& that);
381
  ```
382
 
@@ -394,21 +392,21 @@ template<class BidirectionalIterator, class Allocator>
394
  match_results<BidirectionalIterator, Allocator>& m2);
395
  ```
396
 
397
  *Effects:* As if by `m1.swap(m2)`.
398
 
399
- ### Non-member functions <a id="re.results.nonmember">[[re.results.nonmember]]</a>
400
 
401
  ``` cpp
402
  template<class BidirectionalIterator, class Allocator>
403
  bool operator==(const match_results<BidirectionalIterator, Allocator>& m1,
404
  const match_results<BidirectionalIterator, Allocator>& m2);
405
  ```
406
 
407
  *Returns:* `true` if neither match result is ready, `false` if one match
408
  result is ready and the other is not. If both match results are ready,
409
- returns `true` only if:
410
 
411
  - `m1.empty() && m2.empty()`, or
412
  - `!m1.empty() && !m2.empty()`, and the following conditions are
413
  satisfied:
414
  - `m1.prefix() == m2.prefix()`,
 
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 [[container.alloc.reqmts]] and of a sequence
12
+ container [[container.requirements.general]], [[sequence.reqmts]] except
13
+ that only 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
 
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 = iterator_traits<BidirectionalIterator>::difference_type;
50
+ using size_type = allocator_traits<Allocator>::size_type;
 
51
  using allocator_type = Allocator;
52
+ using char_type = 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& a);
 
67
  bool ready() const;
68
 
69
  // [re.results.size], size
70
  size_type size() const;
71
  size_type max_size() const;
72
+ bool empty() const;
73
 
74
  // [re.results.acc], element access
75
  difference_type length(size_type sub = 0) const;
76
  difference_type position(size_type sub = 0) const;
77
  string_type str(size_type sub = 0) const;
 
110
  void swap(match_results& that);
111
  };
112
  }
113
  ```
114
 
115
+ #### Constructors <a id="re.results.const">[[re.results.const]]</a>
116
 
117
  [[re.results.const]] lists the postconditions of `match_results`
118
  copy/move constructors and copy/move assignment operators. For move
119
  operations, the results of the expressions depending on the parameter
120
  `m` denote the values they had before the respective function calls.
 
176
  | `(*this)[n]` | `m[n]` for all non-negative integers `n < m.size()` |
177
  | `length(n)` | `m.length(n)` for all non-negative integers `n < m.size()` |
178
  | `position(n)` | `m.position(n)` for all non-negative integers `n < m.size()` |
179
 
180
 
181
+ #### State <a id="re.results.state">[[re.results.state]]</a>
182
 
183
  ``` cpp
184
  bool ready() const;
185
  ```
186
 
187
  *Returns:* `true` if `*this` has a fully established result state,
188
  otherwise `false`.
189
 
190
+ #### Size <a id="re.results.size">[[re.results.size]]</a>
191
 
192
  ``` cpp
193
  size_type size() const;
194
  ```
195
 
 
208
 
209
  *Returns:* The maximum number of `sub_match` elements that can be stored
210
  in `*this`.
211
 
212
  ``` cpp
213
+ bool empty() const;
214
  ```
215
 
216
  *Returns:* `size() == 0`.
217
 
218
+ #### Element access <a id="re.results.acc">[[re.results.acc]]</a>
219
 
220
  ``` cpp
221
  difference_type length(size_type sub = 0) const;
222
  ```
223
 
 
289
  ```
290
 
291
  *Returns:* A terminating iterator that enumerates over all the
292
  sub-expressions stored in `*this`.
293
 
294
+ #### Formatting <a id="re.results.form">[[re.results.form]]</a>
295
 
296
  ``` cpp
297
  template<class OutputIter>
298
  OutputIter format(
299
  OutputIter out,
 
360
  format(back_inserter(result), fmt, fmt + char_traits<char_type>::length(fmt), flags);
361
  ```
362
 
363
  *Returns:* `result`.
364
 
365
+ #### Allocator <a id="re.results.all">[[re.results.all]]</a>
366
 
367
  ``` cpp
368
  allocator_type get_allocator() const;
369
  ```
370
 
371
  *Returns:* A copy of the Allocator that was passed to the object’s
372
  constructor or, if that allocator has been replaced, a copy of the most
373
  recent replacement.
374
 
375
+ #### Swap <a id="re.results.swap">[[re.results.swap]]</a>
376
 
377
  ``` cpp
378
  void swap(match_results& that);
379
  ```
380
 
 
392
  match_results<BidirectionalIterator, Allocator>& m2);
393
  ```
394
 
395
  *Effects:* As if by `m1.swap(m2)`.
396
 
397
+ #### Non-member functions <a id="re.results.nonmember">[[re.results.nonmember]]</a>
398
 
399
  ``` cpp
400
  template<class BidirectionalIterator, class Allocator>
401
  bool operator==(const match_results<BidirectionalIterator, Allocator>& m1,
402
  const match_results<BidirectionalIterator, Allocator>& m2);
403
  ```
404
 
405
  *Returns:* `true` if neither match result is ready, `false` if one match
406
  result is ready and the other is not. If both match results are ready,
407
+ returns `true` only if
408
 
409
  - `m1.empty() && m2.empty()`, or
410
  - `!m1.empty() && !m2.empty()`, and the following conditions are
411
  satisfied:
412
  - `m1.prefix() == m2.prefix()`,