Files
cppdraft_translate/cppdraft/task/members.md
2025-10-25 03:02:53 +03:00

50 lines
1.3 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[task.members]
# 33 Execution control library [[exec]](./#exec)
## 33.13 Coroutine utilities [[exec.coro.util]](exec.coro.util#task.members)
### 33.13.6 execution::task [[exec.task]](exec.task#task.members)
#### 33.13.6.3 task members [task.members]
[🔗](#lib:task,constructor)
`task(task&& other) noexcept;
`
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/exec.tex#L7271)
*Effects*: Initializes *handle* with exchange(other.*handle*,{})[.](#1.sentence-1)
[🔗](#lib:task,destructor)
`~task();
`
[2](#2)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/exec.tex#L7282)
*Effects*: Equivalent to:if (*handle*)*handle*.destroy();
[🔗](#lib:connect,task)
`template<[receiver](exec.recv.concepts#concept:receiver "33.7.1Receiver concepts[exec.recv.concepts]") Rcvr>
state<Rcvr> connect(Rcvr&& recv);
`
[3](#3)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/exec.tex#L7297)
*Preconditions*: bool(*handle*) is true[.](#3.sentence-1)
[4](#4)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/exec.tex#L7301)
*Effects*: Equivalent to:return *state*<Rcvr>(exchange(*handle*, {}), std::forward<Rcvr>(recv));