You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/standard-library/match-results-class.md
+5-3Lines changed: 5 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,13 @@
1
1
---
2
2
description: "Learn more about: match_results Class"
3
3
title: "match_results Class"
4
-
ms.date: "09/10/2018"
4
+
ms.date: 06/17/2022
5
5
f1_keywords: ["regex/std::match_results"]
6
6
helpviewer_keywords: ["match_results class"]
7
7
ms.assetid: b504fdca-e5dd-429d-9960-6e27c9167fa6
8
+
ms.custom: devdivchpfy22
8
9
---
10
+
9
11
# match_results Class
10
12
11
13
Holds a sequence of submatches.
@@ -416,7 +418,7 @@ Index of the submatch.
416
418
417
419
### Remarks
418
420
419
-
The member function returns a reference to element *n* of the controlled sequence, or a reference to an empty `sub_match` object if `size() <= n` or if capture group *n*was not part of the match.
421
+
The member function returns a reference to element *n* of the controlled sequence, or a reference to an empty `sub_match` object if `size() <= n` or if capture group *n*wasn't part of the match.
420
422
421
423
## <aname="position"></a> match_results::position
422
424
@@ -539,7 +541,7 @@ The match_results object to swap with.
539
541
540
542
### Remarks
541
543
542
-
The member function swaps the contents of **`*this`** and *right* in constant time and does not throw exceptions.
544
+
The member function swaps the contents of **`*this`** and *right* in constant time and doesn't throw exceptions.
Class template `move_iterator` is a wrapper for an iterator. The move_iterator provides the same behavior as the iterator it wraps (stores), except it turns the stored iterator’s dereference operator into an rvalue reference, turning a copy into a move. For more information about rvalues, see [Rvalue Reference Declarator: &&](../cpp/rvalue-reference-declarator-amp-amp.md).
13
+
Class template `move_iterator` is a wrapper for an iterator. The move_iterator provides the same behavior as the iterator it wraps (stores), except it turns the stored iterator's dereference operator into an rvalue reference, turning a copy into a move. For more information about rvalues, see [Rvalue Reference Declarator: &&](../cpp/rvalue-reference-declarator-amp-amp.md).
12
14
13
15
## Syntax
14
16
@@ -20,7 +22,7 @@ class move_iterator;
20
22
21
23
The class template describes an object that behaves like an iterator except when dereferenced. It stores a random-access iterator of type `Iterator`, accessed by way of the member function `base()`. All operations on a `move_iterator` are performed directly on the stored iterator, except that the result of `operator*` is implicitly cast to `value_type&&` to make an rvalue reference.
22
24
23
-
A `move_iterator` might be capable of operations that are not defined by the wrapped iterator. These operations should not be used.
25
+
A `move_iterator` might be capable of operations that aren't defined by the wrapped iterator. These operations shouldn't be used.
24
26
25
27
### Constructors
26
28
@@ -50,8 +52,8 @@ A `move_iterator` might be capable of operations that are not defined by the wra
|[move_iterator::operator++](#op_add_add)|Increments the stored iterator. Exact behavior depends on whether it is a preincrement or a postincrement operation.|
54
-
|[move_iterator::operator--](#operator--)|Decrements the stored iterator. Exact behavior depends on whether it is a predecrement or a postdecrement operation.|
55
+
|[move_iterator::operator++](#op_add_add)|Increments the stored iterator. Exact behavior depends on whether it's a preincrement or a postincrement operation.|
56
+
|[move_iterator::operator--](#operator--)|Decrements the stored iterator. Exact behavior depends on whether it's a predecrement or a postdecrement operation.|
|[move_iterator::operator-](#operator-)|Returns `move_iterator(*this) -=` by first subtracting the right-hand value from the current position.|
57
59
|[move_iterator::operator[]](#op_at)|Returns `(reference)*(*this + off)`. Allows you to specify an offset from the current base to obtain the value at that location.|
@@ -170,7 +172,7 @@ The operator evaluates `*this += -_Off`. Then returns **`*this`**.
Increments the stored iterator that belongs to this `move_iterator.` The current element is accessed by the postincrement operator. The next element is accessed by the preincrement operator.
175
+
Increments the stored iterator that belongs to this `move_iterator`. The current element is accessed by the postincrement operator. The next element is accessed by the preincrement operator.
The class template ostream_iterator describes an output iterator object that writes successive elements onto the output stream with the extraction `operator <<`.
@@ -121,7 +123,7 @@ A reference to the `ostream_iterator`.
121
123
122
124
### Remarks
123
125
124
-
The requirements for an output iterator that the `ostream_iterator` must satisfy require only the expression \**ii* = *t* be valid and says nothing about the **`operator`** or the `operator=` on their own. The member operator in this implementation returns **\*this**.
126
+
The requirements for an output iterator that the `ostream_iterator` must satisfy require only the expression \**ii* = *t* be valid and says nothing about the **`operator`** or the `operator=` on their own. The member operator in this implementation returns **`*this`**.
125
127
126
128
### Example
127
129
@@ -171,7 +173,7 @@ A reference to the `ostream_iterator`.
Describes an *asynchronous provider* that is a call wrapper whose call signature is `Ty(ArgTypes...)`. Its *associated asynchronous state* holds a copy of its callable object in addition to the potential result.
@@ -33,7 +35,7 @@ class packaged_task;
33
35
|[get_future](#get_future)|Returns a [future](../standard-library/future-class.md) object that has the same associated asynchronous state.|
34
36
|[make_ready_at_thread_exit](#make_ready_at_thread_exit)|Calls the callable object that's stored in the associated asynchronous state and atomically stores the returned value.|
35
37
|[reset](#reset)|Replaces the associated asynchronous state.|
36
-
|[swap](#swap)|Exchanges the associated asynchronous state with that of a specified object.|
38
+
|[swap](#swap)|Exchanges the associated asynchronous state with a specified object.|
37
39
|[valid](#valid)|Specifies whether the object has an associated asynchronous state.|
38
40
39
41
### Public Operators
@@ -60,7 +62,7 @@ future<Ty> get_future();
60
62
61
63
### Remarks
62
64
63
-
If the `packaged_task` object does not have an associated asynchronous state, this method throws a [future_error](../standard-library/future-error-class.md) that has an error code of `no_state`.
65
+
If the `packaged_task` object doesn't have an associated asynchronous state, this method throws a [future_error](../standard-library/future-error-class.md) that has an error code of `no_state`.
64
66
65
67
If this method has already been called for a `packaged_task` object that has the same associated asynchronous state, the method throws a `future_error` that has an error code of `future_already_retrieved`.
66
68
@@ -80,7 +82,7 @@ If this method or [make_ready_at_thread_exit](#make_ready_at_thread_exit) has al
80
82
81
83
Otherwise, this operator calls `INVOKE(fn, args..., Ty)`, where *fn* is the callable object that's stored in the associated asynchronous state. Any returned value is stored atomically as the returned result of the associated asynchronous state.
82
84
83
-
In contrast to [packaged_task::operator()](#op_call), the associated asynchronous state is not set to `ready` until after all thread-local objects in the calling thread have been destroyed. Typically, threads that are blocked on the associated asynchronous state are not unblocked until the calling thread exits.
85
+
In contrast to [packaged_task::operator()](#op_call), the associated asynchronous state isn't set to `ready` until after all thread-local objects in the calling thread have been destroyed. Typically, threads that are blocked on the associated asynchronous state aren't unblocked until the calling thread exits.
84
86
85
87
## <a name="op_eq"></a> packaged_task::operator=
86
88
@@ -177,7 +179,7 @@ Destroys a `packaged_task` object.
177
179
178
180
### Remarks
179
181
180
-
If the *associated asynchronous state*is not*ready*, the destructor stores a [future_error](../standard-library/future-error-class.md) exception that has an error code of `broken_promise` as the result in the associated asynchronous state, and any threads that are blocked on the associated asynchronous state become unblocked.
182
+
If the *associated asynchronous state*isn't*ready*, the destructor stores a [future_error](../standard-library/future-error-class.md) exception that has an error code of `broken_promise` as the result in the associated asynchronous state, and any threads that are blocked on the associated asynchronous state become unblocked.
181
183
182
184
## <aname="reset"></a> packaged_task::reset
183
185
@@ -189,11 +191,11 @@ void reset();
189
191
190
192
### Remarks
191
193
192
-
In effect, this method executes `*this = packaged_task(move(fn))`, where *fn* is the function object that's stored in the associated asynchronous state for this object. Therefore, the state of the object is cleared, and [get_future](#get_future), [operator()](#op_call), and [make_ready_at_thread_exit](#make_ready_at_thread_exit) can be called as if on a newly-constructed object.
194
+
In effect, this method executes `*this = packaged_task(move(fn))`, where *fn* is the function object that's stored in the associated asynchronous state for this object. Therefore, the state of the object is cleared, and [get_future](#get_future), [operator()](#op_call), and [make_ready_at_thread_exit](#make_ready_at_thread_exit) can be called as if on a newlyconstructed object.
193
195
194
196
## <aname="swap"></a> packaged_task::swap
195
197
196
-
Exchanges the associated asynchronous state with that of a specified object.
198
+
Exchanges the associated asynchronous state with a specified object.
The **`path`** class stores an object of type `string_type`, called `myname` here for the purposes of exposition, suitable for use as a pathname. `string_type` is a synonym for `basic_string<value_type>`, where `value_type` is a synonym for **`wchar_t`** on Windows or **`char`** on POSIX.
A memory allocator. See [\<allocators>](../standard-library/allocators-header.md) for more information.
105
+
A memory allocator. For more information about allocators, see [\<allocators>](../standard-library/allocators-header.md).
105
106
106
107
*Other*\
107
108
A `promise` object.
@@ -154,7 +155,7 @@ If the promise object has no *associated asynchronous state*, this method throws
154
155
155
156
If [set_exception](#set_exception), `set_exception_at_thread_exit`, [set_value](#set_value), or [set_value_at_thread_exit](#set_value_at_thread_exit) has already been called for a `promise` object that has the same associated asynchronous state, this method throws a `future_error` that has an error code of `promise_already_satisfied`.
156
157
157
-
In contrast to [set_exception](#set_exception), this method does not set the associated asynchronous state to ready until after all thread-local objects in the current thread have been destroyed. Typically, threads that are blocked on the associated asynchronous state are not unblocked until the current thread exits.
158
+
In contrast to [set_exception](#set_exception), this method doesn't set the associated asynchronous state to ready until after all thread-local objects in the current thread have been destroyed. Typically, threads that are blocked on the associated asynchronous state aren't unblocked until the current thread exits.
158
159
159
160
## <a name="set_value"></a> promise::set_value
160
161
@@ -180,9 +181,9 @@ If [set_exception](#set_exception), [set_exception_at_thread_exit](#set_exceptio
180
181
181
182
As a result of this method, any threads that are blocked on the associated asynchronous state become unblocked.
182
183
183
-
The first method also throws any exception that is thrown when *Val* is copied into the associated asynchronous state. In this situation, the associated asynchronous state is not set to ready.
184
+
The first method also throws any exception that is thrown when *Val* is copied into the associated asynchronous state. In this situation, the associated asynchronous state isn't set to ready.
184
185
185
-
The second method also throws any exception that is thrown when *Val* is moved into the associated asynchronous state. In this situation, the associated asynchronous state is not set to ready.
186
+
The second method also throws any exception that is thrown when *Val* is moved into the associated asynchronous state. In this situation, the associated asynchronous state isn't set to ready.
186
187
187
188
For the partial specialization `promise<Ty&>`, the stored value is in effect a reference to *Val*.
188
189
@@ -210,7 +211,7 @@ If the promise object has no *associated asynchronous state*, this method throws
210
211
211
212
If [set_exception](#set_exception), [set_exception_at_thread_exit](#set_exception_at_thread_exit), [set_value](#set_value), or `set_value_at_thread_exit` has already been called for a `promise` object that has the same associated asynchronous state, this method throws a `future_error` that has an error code of `promise_already_satisfied`.
212
213
213
-
In contrast to `set_value`, the associated asynchronous state is not set to ready until after all thread-local objects in the current thread have been destroyed. Typically, threads that are blocked on the associated asynchronous state are not unblocked until the current thread exits.
214
+
In contrast to `set_value`, the associated asynchronous state isn't set to ready until after all thread-local objects in the current thread have been destroyed. Typically, threads that are blocked on the associated asynchronous state aren't unblocked until the current thread exits.
214
215
215
216
The first method also throws any exception that is thrown when *Val* is copied into the associated asynchronous state.
0 commit comments