+TEST(Optional, NoThrowDefaultConstructible) {
+ EXPECT_TRUE(std::is_nothrow_default_constructible<Optional<bool>>::value);
+}
+
+struct NoDestructor {};
+
+struct WithDestructor {
+ ~WithDestructor();
+};
+
+TEST(Optional, TriviallyDestructible) {
+ // These could all be static_asserts but EXPECT_* give much nicer output on
+ // failure.
+ EXPECT_TRUE(std::is_trivially_destructible<Optional<NoDestructor>>::value);
+ EXPECT_TRUE(std::is_trivially_destructible<Optional<int>>::value);
+ EXPECT_FALSE(std::is_trivially_destructible<Optional<WithDestructor>>::value);
+}
+
+TEST(Optional, Hash) {
+ // Test it's usable in std::unordered map (compile time check)
+ std::unordered_map<Optional<int>, Optional<int>> obj;
+ // Also check the std::hash template can be instantiated by the compiler
+ std::hash<Optional<int>>()(none);
+ std::hash<Optional<int>>()(3);
+}