| 72 | // - generator<X, X&> ill-formed | ref | ill-formed |
| 73 | |
| 74 | struct X { |
| 75 | int id; |
| 76 | |
| 77 | X(int id) : id(id) { std::printf("X::X(%i)\n", id); } |
| 78 | |
| 79 | X(const X &x) : id(x.id) { std::printf("X::X(copy %i)\n", id); } |
| 80 | |
| 81 | X(X &&x) : id(std::exchange(x.id, -1)) { |
| 82 | std::printf("X::X(move %i)\n", id); |
| 83 | } |
| 84 | |
| 85 | ~X() { std::printf("X::~X(%i)\n", id); } |
| 86 | }; |
| 87 | |
| 88 | co_context::generator<X> always_ref_example() { |
| 89 | co_yield X{1}; |
nothing calls this directly
no outgoing calls
no test coverage detected