Originally posted by pal666
View Post
Announcement
Collapse
No announcement yet.
GCC 11 Enables Co-Routines Support In C++20 Mode
Collapse
X
-
- Likes 2
-
Originally posted by dev_null View PostThanks!. Looks like it won't work on Linux at full power though, and most likely won't work at gcc-10 without some adoption.
Leave a comment:
-
Originally posted by Mark625 View PostI'm kind of curious about what the motivation is for co-routines, though, since threads are better and fully supported.
- Likes 1
Leave a comment:
-
Originally posted by pal666 View Postit is possible, boost provides one. stackful and stackless both have their pros and cons, it's good to have both(or something combined, and there was an effort to combine them, but it wasn't successful yet)
microsoft was impatient because they need them for their api
So I was extremely disappointed that the new coroutines just don't allow me to do this anyhow easily.
Leave a comment:
-
Originally posted by kreijack View Post
The current implementation is the basic plumbing on which it is possible to build a library support. The intended use is not for the generic developer. You should look to a library like cppcoro https://github.com/lewissbaker/cppcoro which is a lot more user friendly :
Code:using cppcoro; generator<const std::uint64_t> fibonacci() { std::uint64_t a = 0, b = 1; while (true) { co_yield b; auto tmp = a; a = b; b += tmp; } } void usage() { for (auto i : fibonacci()) { if (i > 1'000'000) break; std::cout << i << std::endl; } }
Leave a comment:
-
Originally posted by kreijack View PostCode:std::cout << i << std::endl;
http://CppCon.org—Presentation Slides, PDFs, Source Code and other presenter materials are available at: https://github.com/CppCon/CppCon2017—Lightning Talk—...
Leave a comment:
-
Originally posted by dev_null View Postthese new coroutines are extremely hard to use. Everyone who doesn’t believe welcome to try. I have no idea why it was not possible to provide stackfull coroutines python or java script style ??
Originally posted by dev_null View PostHowever I know the current implementation in the standard was proposed by a guy from Microsoft.
Leave a comment:
Leave a comment: