This commit is contained in:
Simon Brand
2019-07-08 11:49:21 +01:00
committed by Deniz Evrenci
parent b074bee409
commit ce266d5280

View File

@ -31,4 +31,15 @@ TEST_CASE("issue 15") {
o = o;
REQUIRE(o->value == 42);
}
TEST_CASE("issue 33") {
int i = 0;
int j = 0;
tl::optional<int&> a = i;
a.emplace(j);
*a = 42;
REQUIRE(j == 42);
REQUIRE(*a == 42);
REQUIRE(a.has_value());
}