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

Function xvalue_example

test/generator_test.cpp:106–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

104}
105
106co_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
114co_context::generator<const X &> const_lvalue_example() {
115 co_yield X{1}; // OK

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected