static_assert(implicit_conversion<long double>(3.14, 3.14), "");
}
{
+ int x = 42;
+ optional<void* const> o(&x);
+ assert(*o == &x);
+ }
+ {
using T = TrivialTestTypes::TestType;
static_assert(implicit_conversion<T>(42, 42), "");
}
}
{
+ const int x = 42;
+ optional<const int> o(x);
+ assert(*o == x);
+ }
+ {
typedef TestTypes::TestType T;
T::reset();
const T t(3);
test<int>();
test<int>(3);
{
+ const optional<const int> o(42);
+ optional<const int> o2(o);
+ assert(*o2 == 42);
+ }
+ {
using T = TestTypes::TestType;
T::reset();
const optional<T> rhs;
}
{
+ optional<const int> opt(in_place, 5);
+ assert(*opt == 5);
+ }
+ {
const optional<X> opt(in_place);
assert(static_cast<bool>(opt) == true);
assert(*opt == X());
test<int>();
test<int>(3);
{
+ optional<const int> o(42);
+ optional<const int> o2(std::move(o));
+ assert(*o2 == 42);
+ }
+ {
using T = TestTypes::TestType;
T::reset();
optional<T> rhs;
};
}
{
+ const int x = 42;
+ optional<const int> o(std::move(x));
+ assert(*o == 42);
+ }
+ {
typedef TestTypes::TestType T;
T::reset();
optional<T> opt = T{3};