-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
yield immediate value? #42
Comments
@CarterLi enumerable should be used with reference. 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. coroutine/modules/net/io_linux.cpp Lines 17 to 26 in 5ddc501
|
But it's ugly. coro::enumerable<int> test() {
int i = 1;
co_yield i;
} |
Well, indeed I agree with the point. Let me change that. If you're in an urgent situation, you can try existing generator implementations in https://github.com/Quuxplusone/coro. I strongly recommend those works. |
The text was updated successfully, but these errors were encountered: