W
Size: a a a
W
R
АК
R
#include <iostream>
#include <coroutine>
#include <ranges>
std::generator<unsigned> gen(unsigned start, unsigned step = 1) {
while(1) {
co_yield start += step;
}
}
int main() {
auto g = gen(0);
for(auto i : std::views::iota(0, 100)) {
std::cout << g << std::endl;
}
}
R
R
root@c7c77c58b545:/usr/src/myapp# c++ -std=c++2a -fcoroutines gen.cpp
gen.cpp:5:6: error: 'generator' in namespace 'std' does not name a template type; did you mean 'generate'?
5 | std::generator<unsigned> gen(unsigned start, unsigned step = 1) {
| ^~~~~~~~~
| generate
gen.cpp: In function 'int main()':
gen.cpp:12:14: error: 'gen' was not declared in this scope
12 | auto g = gen(0);
| ^~~
G
G
TS
Е
TS
Е
TS
Е
АК
Е
АК
Е
STILL failing
АК