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

Function const_lvalue_example

test/generator_test.cpp:114–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

112}
113
114co_context::generator<const X &> const_lvalue_example() {
115 co_yield X{1}; // OK
116 const X x{2};
117 co_yield x; // OK
118 co_yield std::move(x); // OK: same as above
119}
120
121co_context::generator<X &> lvalue_example() {
122 // co_yield X{1}; // ill-formed: prvalue -> non-const lvalue

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected