In-place construction for Future
[folly.git] / folly / futures / test / FutureTest.cpp
index e886a21a74bcb9e43244debb4bc30076a8c0f827..4dd3f2dc574239d9c6c5d76c5b567c0fbe6e23cb 100644 (file)
@@ -810,6 +810,11 @@ TEST(Future, ImplicitConstructor) {
   //auto f2 = []() -> Future<Unit> { }();
 }
 
+TEST(Future, InPlaceConstructor) {
+  auto f = Future<std::pair<int, double>>(in_place, 5, 3.2);
+  EXPECT_EQ(5, f.value().first);
+}
+
 TEST(Future, thenDynamic) {
   // folly::dynamic has a constructor that takes any T, this test makes
   // sure that we call the then lambda with folly::dynamic and not