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

Function lvalue_example

test/generator_test.cpp:121–126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

119}
120
121co_context::generator<X &> lvalue_example() {
122 // co_yield X{1}; // ill-formed: prvalue -> non-const lvalue
123 X x{2};
124 co_yield x; // OK
125 // co_yield std::move(x); // ill-formed: xvalue -> non-const lvalue
126}
127
128///////////////////////////////////
129// These examples show different usages of reference/value_type

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected