Don't destroy value in expected<void,E>

Fixes #43
This commit is contained in:
Simon Brand
2018-11-11 11:25:16 +00:00
parent 08b39b8042
commit 89670f8b21
2 changed files with 16 additions and 3 deletions
+5
View File
@@ -100,4 +100,9 @@ struct non_copyable {
TEST_CASE("Issue 42", "[issues.42]") {
tl::expected<non_copyable,int>{}.map([](non_copyable) {});
}
TEST_CASE("Issue 43", "[issues.43]") {
auto result = tl::expected<void, std::string>{};
result = tl::make_unexpected(std::string{ "foo" });
}