Promise<int> pi;
Future<bool> fb = pb.getFuture();
Future<int> fi = pi.getFuture();
- bool flag = false;
auto f = collect(std::move(fb), std::move(fi));
pb.setValue(true);
EXPECT_FALSE(f.isReady());
auto f = collectAll(fs);
EXPECT_TRUE(f.isReady());
}
+
+TEST(Collect, noDefaultConstructor) {
+ struct A {
+ explicit A(size_t /* x */) {}
+ };
+
+ auto f1 = makeFuture(A(1));
+ auto f2 = makeFuture(A(2));
+
+ auto f = collect(std::move(f1), std::move(f2));
+}