Skip to content

Commit

Permalink
cpp20/coroutines: 微調整
Browse files Browse the repository at this point in the history
  • Loading branch information
yohhoy committed Jan 3, 2023
1 parent ab69dd5 commit 384970b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lang/cpp20/coroutines.md
Expand Up @@ -373,7 +373,7 @@ _e_ をYield式のオペランド、_p_ を同式を含むコルーチンのProm

```cpp
template <typename T>
struct my_generator {
struct generator {
struct promise_type {
T current_value;
/* ... */
Expand All @@ -387,10 +387,10 @@ struct my_generator {
iterator end();
};

my_generator<pair<int,int>> g1() {
generator<pair<int,int>> g1() {
for (int i = i; i < 10; ++i) co_yield {i,i};
}
my_generator<pair<int,int>> g2() {
generator<pair<int,int>> g2() {
for (int i = i; i < 10; ++i) co_yield make_pair(i,i);
}

Expand Down

0 comments on commit 384970b

Please sign in to comment.