Comments (3)
But it's ugly.
coro::enumerable<int> test() {
int i = 1;
co_yield i;
}
from coroutine.
@CarterLi enumerable should be used with reference.
Most of generators are allowing T&&
, but it doesn't.
coroutine/interface/coroutine/yield.hpp
Lines 82 to 86 in 5ddc501
The reason for such restriction is to enforce users to reuse existing variable in the coroutine frame.
For example, the code below is reusing the object io_task_t task{};
.
coroutine/modules/net/io_linux.cpp
Lines 17 to 26 in 5ddc501
from coroutine.
Well, indeed I agree with the point. Let me change that.
But I couldn't work on this project recently and probably the state will remain unchanged for more upcoming weeks... I'm really sorry about that. I will work as soon as possible and let you know.
If you're in an urgent situation, you can try existing generator implementations in https://github.com/Quuxplusone/coro. I strongly recommend those works.
from coroutine.
Related Issues (20)
- Better worker thread for POSIX
- Package support HOT 2
- Review: Open Standard Docs HOT 1
- Survey for common concepts HOT 2
- Working with Concurrency TS HOT 2
- clang ignores template functions for `co_await`? HOT 2
- catch2 reports "corrupted double-linked list" HOT 5
- Preparing GCC for Coroutine project HOT 1
- More pretty documentation HOT 4
- Review: N4820 HOT 1
- test for sequence(async generator) fails on clang release build HOT 5
- Coroutine Frame support for the GCC-10(coroutines branch) HOT 3
- Webassembly HOT 6
- build support: clang-9 HOT 1
- Need more return types
- Coroutine build failed with error C7651 HOT 1
- Test suite should consider current compiler version and SDK
- USE_PORTABLE_COROUTINE_HANDLE has no effect HOT 2
- Builtins are missing on macOS 13.5/XCode 14.3.1 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from coroutine.