cppcoro icon indicating copy to clipboard operation
cppcoro copied to clipboard

Having problem returning future from cppcoro::generator

Open Xyncgas opened this issue 4 years ago • 2 comments

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 avatar Jan 08 '21 10:01 Xyncgas

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 avatar Jan 08 '21 10:01 Xyncgas

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

Xyncgas avatar Jan 08 '21 11:01 Xyncgas