Files
2025-10-25 03:02:53 +03:00

39 lines
1.8 KiB
Markdown
Raw Permalink 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.

[coroutine.traits]
# 17 Language support library [[support]](./#support)
## 17.13 Coroutines [[support.coroutine]](support.coroutine#coroutine.traits)
### 17.13.3 Coroutine traits [coroutine.traits]
#### [17.13.3.1](#general) General [[coroutine.traits.general]](coroutine.traits.general)
[1](#general-1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/support.tex#L5798)
Subclause [coroutine.traits] defines requirements on classes representing[*coroutine traits*](#def:coroutine_traits),
and defines the class templatecoroutine_traits that meets those requirements[.](#general-1.sentence-1)
#### [17.13.3.2](#primary) Class template coroutine_traits [[coroutine.traits.primary]](coroutine.traits.primary)
[1](#primary-1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/support.tex#L5808)
The header [<coroutine>](coroutine.syn#header:%3ccoroutine%3e "17.13.2Header <coroutine> synopsis[coroutine.syn]") defines the primary templatecoroutine_traits such that
if ArgTypes is a parameter pack of types and
if the [*qualified-id*](expr.prim.id.qual#nt:qualified-id "7.5.5.3Qualified names[expr.prim.id.qual]") R::promise_type is valid and
denotes a type ([[temp.deduct]](temp.deduct "13.10.3Template argument deduction")),
then coroutine_traits<R, ArgTypes...> has the following publicly
accessible member:using promise_type = typename R::promise_type;
Otherwise, coroutine_traits<R, ArgTypes...> has no members[.](#primary-1.sentence-2)
[2](#primary-2)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/support.tex#L5822)
Program-defined specializations of this template shall define a publicly
accessible nested type named promise_type[.](#primary-2.sentence-1)