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

Function always_ref_example

test/generator_test.cpp:88–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86};
87
88co_context::generator<X> always_ref_example() {
89 co_yield X{1};
90 {
91 X x{2};
92 co_yield x;
93 assert(x.id == 2);
94 }
95 {
96 const X x{3};
97 co_yield x;
98 assert(x.id == 3);
99 }
100 {
101 X x{4};
102 co_yield std::move(x);
103 }
104}
105
106co_context::generator<X &&> xvalue_example() {
107 co_yield X{1};

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected