diff --git a/result.hpp b/result.hpp index 64c4d4e..fa9007c 100644 --- a/result.hpp +++ b/result.hpp @@ -219,9 +219,9 @@ public: * otherwise */ template - T recover(UnaryFunctionError apply_error) const + Result recover(UnaryFunctionError apply_error) const { - T val; + Result val; match([&val](T value) { val = value; }, [&val, &apply_error](Error error) { val = apply_error(error);