MCPcopy Create free account
hub / github.com/andreasfertig/programming-with-cpp20 / counter

Function counter

02.04-coroutineLimitlessSequence0/main.cpp:97–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

95void UseCounterValue(int i);
96
97IntGenerator // #A Returning a coroutine object
98counter(int start, int end)
99{
100 while(start <= end) {
101 co_yield start; // #B Yielding a value and giving control back to the caller
102 ++start;
103 }
104}
105
106void UseCounter()
107{

Callers 1

UseCounterFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected