| 95 | void UseCounterValue(int i); |
| 96 | |
| 97 | IntGenerator // #A Returning a coroutine object |
| 98 | counter(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 | |
| 106 | void UseCounter() |
| 107 | { |