From b2f609307689b71fc156afd60513be5ca352ef37 Mon Sep 17 00:00:00 2001 From: Evgeniy Alekseev Date: Wed, 12 Dec 2018 02:20:39 +0300 Subject: [PATCH] return result on recover --- result.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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);