Make Optional nothrow_default_constructible
[folly.git] / folly / test / OptionalTest.cpp
index 42fd4926808156978f27a07c0425546fa492e85c..0c3d9fdc95b2375fc26c52a64c70d7e82877bf92 100644 (file)
@@ -21,6 +21,7 @@
 #include <algorithm>
 #include <iomanip>
 #include <string>
+#include <type_traits>
 
 #include <glog/logging.h>
 #include <gtest/gtest.h>
@@ -542,4 +543,8 @@ TEST(Optional, Exceptions) {
   EXPECT_THROW(empty.value(), OptionalEmptyException);
 }
 
+TEST(Optional, NoThrowDefaultConstructible) {
+  EXPECT_TRUE(std::is_nothrow_default_constructible<Optional<bool>>::value);
+}
+
 }