Skip to content

Commit

Permalink
generator: 微調整
Browse files Browse the repository at this point in the history
  • Loading branch information
yohhoy committed Jan 23, 2023
1 parent 7389f02 commit 7208b79
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions reference/generator/generator.md
Expand Up @@ -18,6 +18,7 @@ namespace std {
## 概要
`generator`クラステンプレートは、[コルーチン](/lang/cpp20/coroutines.md)の評価により生成される要素列のビュー(view)を表現する。
特殊化された`generator`は[`view`](/reference/ranges/view.md)および[`input_range`](/reference/ranges/input_range.md)のモデルである。
`generator`はムーブのみ可能なオブジェクトである。
戻り値型`generator`のコルーチン(以下、ジェネレータコルーチン)では`co_yield`式を用いて値を生成する。`co_yield` [`std::ranges::elements_of`](/reference/ranges/elements_of.md)`(rng)`式を用いると、ジェネレータコルーチンから入れ子Range(`rng`)の各要素を逐次生成する。
ジェネレータコルーチンでは`co_await`式を利用できない。
Expand Down

0 comments on commit 7208b79

Please sign in to comment.