| 104 | } |
| 105 | |
| 106 | co_context::generator<X &&> xvalue_example() { |
| 107 | co_yield X{1}; |
| 108 | X x{2}; |
| 109 | co_yield x; // well-formed: generated element is copy of lvalue |
| 110 | assert(x.id == 2); |
| 111 | co_yield std::move(x); |
| 112 | } |
| 113 | |
| 114 | co_context::generator<const X &> const_lvalue_example() { |
| 115 | co_yield X{1}; // OK |