forked from TartanLlama/expected
+20
-1
@@ -105,4 +105,23 @@ TEST_CASE("Issue 42", "[issues.42]") {
|
||||
TEST_CASE("Issue 43", "[issues.43]") {
|
||||
auto result = tl::expected<void, std::string>{};
|
||||
result = tl::make_unexpected(std::string{ "foo" });
|
||||
}
|
||||
}
|
||||
|
||||
#include <memory>
|
||||
|
||||
using MaybeDataPtr = tl::expected<int, std::unique_ptr<int>>;
|
||||
|
||||
MaybeDataPtr test(int i) noexcept
|
||||
{
|
||||
return std::move(i);
|
||||
}
|
||||
|
||||
MaybeDataPtr test2(int i) noexcept
|
||||
{
|
||||
return std::move(i);
|
||||
}
|
||||
|
||||
TEST_CASE("Issue 49", "[issues.49]") {
|
||||
auto m = test(10)
|
||||
.and_then(test2);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user