forked from TartanLlama/expected
Fix #42
This commit is contained in:
@ -91,3 +91,13 @@ TEST_CASE("Issue 34", "[issues.34]") {
|
|||||||
.and_then (work2);
|
.and_then (work2);
|
||||||
result.map_error ([&] (std::string result) {errorhandling (result);});
|
result.map_error ([&] (std::string result) {errorhandling (result);});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct non_copyable {
|
||||||
|
non_copyable(non_copyable&&) = default;
|
||||||
|
non_copyable(non_copyable const&) = delete;
|
||||||
|
non_copyable() = default;
|
||||||
|
};
|
||||||
|
|
||||||
|
TEST_CASE("Issue 42", "[issues.42]") {
|
||||||
|
tl::expected<non_copyable,int>{}.map([](non_copyable) {});
|
||||||
|
}
|
@ -1301,7 +1301,7 @@ public:
|
|||||||
/// \synopsis template <class F> constexpr auto map(F &&f) &&;
|
/// \synopsis template <class F> constexpr auto map(F &&f) &&;
|
||||||
template <class F>
|
template <class F>
|
||||||
TL_EXPECTED_11_CONSTEXPR decltype(
|
TL_EXPECTED_11_CONSTEXPR decltype(
|
||||||
expected_map_impl(std::declval<expected &>(), std::declval<F &&>()))
|
expected_map_impl(std::declval<expected>(), std::declval<F &&>()))
|
||||||
map(F &&f) && {
|
map(F &&f) && {
|
||||||
return expected_map_impl(std::move(*this), std::forward<F>(f));
|
return expected_map_impl(std::move(*this), std::forward<F>(f));
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user