Add one more test for optional

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@333252 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Marshall Clow
2018-05-25 02:22:54 +00:00
parent 2fac2d790f
commit 756163dbc1

View File

@@ -41,4 +41,13 @@ int main()
// Test the implicit deduction guides // Test the implicit deduction guides
{
// optional(const optional &);
std::optional<char> source('A');
std::optional opt(source);
static_assert(std::is_same_v<decltype(opt), std::optional<char>>, "");
assert(static_cast<bool>(opt) == static_cast<bool>(source));
assert(*opt == *source);
}
} }