MCPcopy Create free account
hub / github.com/Codesire-Deng/co_context / X

Class X

test/generator_test.cpp:74–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72// - generator<X, X&> ill-formed | ref | ill-formed
73
74struct 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
88co_context::generator<X> always_ref_example() {
89 co_yield X{1};

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected