Skip to content

when_all does not support continuing futures that return void #79

@Diltsman

Description

@Diltsman

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;
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions