forked from TartanLlama/expected
+ Fixed unused variable warning + Added a `std::move` to avoid calling copy-assignment operator on non-copyable types Co-authored-by: andy-byers <andrew.byers@utdallas.edu>
This commit is contained in:
co-authored by
andy-byers
parent
79a2068c9a
commit
f5e6e9aeed
@@ -183,4 +183,12 @@ TEST_CASE("Issue 107", "[issues.107]") {
|
||||
REQUIRE(ex1.error().j == 0);
|
||||
REQUIRE(ex2.error().i == 2);
|
||||
REQUIRE(ex2.error().j == 2);
|
||||
}
|
||||
|
||||
TEST_CASE("Issue 129", "[issues.129]") {
|
||||
tl::expected<std::unique_ptr<int>, int> x1 {std::make_unique<int>(4)};
|
||||
tl::expected<std::unique_ptr<int>, int> y1 {std::make_unique<int>(2)};
|
||||
x1 = std::move(y1);
|
||||
|
||||
REQUIRE(**x1 == 2);
|
||||
}
|
||||
Reference in New Issue
Block a user