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

when_all does not support continuing futures that return void #79

Closed
Diltsman opened this issue Jul 26, 2017 · 3 comments
Closed

when_all does not support continuing futures that return void #79

Diltsman opened this issue Jul 26, 2017 · 3 comments
Milestone

Comments

@Diltsman
Copy link

The following code fails to compile on VS2015 Update 3. If futures are changed to take and return ints, then everything works.

#include <stlab/concurrency/concurrency.hpp>

#include <iostream>
int main(int argc, char *argv[])
{
	std::cout << "1\n";
	auto future = stlab::async(stlab::default_executor, [] {std::cout << "2\n"; });
	auto future2 = future.then([] {std::cout << "3\n"; }).then([] {std::cout << "5\n"; });
	auto future3 = future.then([] {std::cout << "4\n"; });
	auto future4 = stlab::when_all(stlab::default_executor, [] {std::cout << "6\n"; }, future2, future3);

	std::cout << "7\n";
	while (!future4.get_try());
	return 0;
}
@fosterbrereton
Copy link
Member

Thanks for the report- we are aware of the issue and are looking into it.

@fosterbrereton
Copy link
Member

This has been fixed in develop as of d91c3f0 and will be part of the next release.

@fosterbrereton
Copy link
Member

This issue has been fixed in master as of the 1.1 release.

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

No branches or pull requests

2 participants