Skip to content
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

Having problem returning future from cppcoro::generator #190

Open
Xyncgas opened this issue Jan 8, 2021 · 2 comments
Open

Having problem returning future from cppcoro::generator #190

Xyncgas opened this issue Jan 8, 2021 · 2 comments

Comments

@Xyncgas
Copy link

Xyncgas commented Jan 8, 2021

cppcoro::generator<std::optional<std::futurestd::string>> object_list (std::string* input)
{
...
co_yield {};
...
while(...==true)
{
co_yield (std::async(std::launch::async, = {return HttpGetString_convertedTo_stdString(target); }))
}
}

int main()
{
for (auto element : object_list(a)
{
//Object_list showing error in visual studio
}
}
image

@Xyncgas
Copy link
Author

Xyncgas commented Jan 8, 2021

I am not a very good github user please forgive my formatting, I was exploring on my own and wanted to do something like this and I can't fix it

@Xyncgas
Copy link
Author

Xyncgas commented Jan 8, 2021

nvm, I feel like shared_future is needed for supporting this, please close the repo after reading it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant