tmp/tmpb__gc6cd/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,70 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
##### Members <a id="exec.simple.counting.mem">[[exec.simple.counting.mem]]</a>
|
| 2 |
+
|
| 3 |
+
``` cpp
|
| 4 |
+
token get_token() noexcept;
|
| 5 |
+
```
|
| 6 |
+
|
| 7 |
+
*Returns:* An object `t` of type `simple_counting_scope::token` such
|
| 8 |
+
that `t.`*`scope`*` == this` is `true`.
|
| 9 |
+
|
| 10 |
+
``` cpp
|
| 11 |
+
void close() noexcept;
|
| 12 |
+
```
|
| 13 |
+
|
| 14 |
+
*Effects:* If *state* is
|
| 15 |
+
|
| 16 |
+
- *unused*, then changes *state* to *unused-and-closed*;
|
| 17 |
+
- *open*, then changes *state* to *closed*;
|
| 18 |
+
- *open-and-joining*, then changes *state* to *closed-and-joining*;
|
| 19 |
+
- otherwise, no effects.
|
| 20 |
+
|
| 21 |
+
*Ensures:* Any subsequent call to *`try-associate`*`()` on `*this`
|
| 22 |
+
returns `false`.
|
| 23 |
+
|
| 24 |
+
``` cpp
|
| 25 |
+
sender auto join() noexcept;
|
| 26 |
+
```
|
| 27 |
+
|
| 28 |
+
*Returns:* *`make-sender`*`(`*`scope-join-t`*`(), this)`.
|
| 29 |
+
|
| 30 |
+
``` cpp
|
| 31 |
+
bool try-associate() noexcept;
|
| 32 |
+
```
|
| 33 |
+
|
| 34 |
+
*Effects:* If *count* is equal to `max_associations`, then no effects.
|
| 35 |
+
Otherwise, if *state* is
|
| 36 |
+
|
| 37 |
+
- *unused*, then increments *count* and changes *state* to *open*;
|
| 38 |
+
- *open* or *open-and-joining*, then increments *count*;
|
| 39 |
+
- otherwise, no effects.
|
| 40 |
+
|
| 41 |
+
*Returns:* `true` if *count* was incremented, `false` otherwise.
|
| 42 |
+
|
| 43 |
+
``` cpp
|
| 44 |
+
void disassociate() noexcept;
|
| 45 |
+
```
|
| 46 |
+
|
| 47 |
+
*Preconditions:* *count* is greater than zero.
|
| 48 |
+
|
| 49 |
+
*Effects:* Decrements *count*. If *count* is zero after decrementing and
|
| 50 |
+
*state* is *open-and-joining* or *closed-and-joining*, changes *state*
|
| 51 |
+
to *joined* and calls *`complete`*`()` on all objects registered with
|
| 52 |
+
`*this`.
|
| 53 |
+
|
| 54 |
+
[*Note 1*: Calling *`complete`*`()` on any registered object can cause
|
| 55 |
+
`*this` to be destroyed. — *end note*]
|
| 56 |
+
|
| 57 |
+
``` cpp
|
| 58 |
+
template<class State>
|
| 59 |
+
bool start-join-sender(State& st) noexcept;
|
| 60 |
+
```
|
| 61 |
+
|
| 62 |
+
*Effects:* If *state* is
|
| 63 |
+
|
| 64 |
+
- *unused*, *unused-and-closed*, or *joined*, then changes *state* to
|
| 65 |
+
*joined* and returns `true`;
|
| 66 |
+
- *open* or *open-and-joining*, then changes *state* to
|
| 67 |
+
*open-and-joining*, registers `st` with `*this` and returns `false`;
|
| 68 |
+
- *closed* or *closed-and-joining*, then changes *state* to
|
| 69 |
+
*closed-and-joining*, registers `st` with `*this` and returns `false`.
|
| 70 |
+
|