| 119 | } |
| 120 | |
| 121 | co_context::generator<X &> lvalue_example() { |
| 122 | // co_yield X{1}; // ill-formed: prvalue -> non-const lvalue |
| 123 | X x{2}; |
| 124 | co_yield x; // OK |
| 125 | // co_yield std::move(x); // ill-formed: xvalue -> non-const lvalue |
| 126 | } |
| 127 | |
| 128 | /////////////////////////////////// |
| 129 | // These examples show different usages of reference/value_type |