From 1b8bd379edb230d1a06aab1240501302934c25a7 Mon Sep 17 00:00:00 2001 From: Nerijus Arlauskas Date: Tue, 19 Jul 2016 11:38:37 +0300 Subject: [PATCH] Fix incorrect forwarding of lambda value. --- src/maybe/result.inline.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/maybe/result.inline.hpp b/src/maybe/result.inline.hpp index 0802ac8..68652cf 100644 --- a/src/maybe/result.inline.hpp +++ b/src/maybe/result.inline.hpp @@ -21,7 +21,7 @@ inline auto maybe::result::map(F f) noexcept -> maybe::result(err_value())); } - return return_result_t::ok(f(std::forward(ok_value()))); + return return_result_t::ok(f(ok_value())); }; template @@ -45,7 +45,7 @@ inline auto maybe::result::map_err(F f) noexcept if (is_ok()) { return return_result_t::ok(std::forward(ok_value())); } - return return_result_t::err(f(std::forward(err_value()))); + return return_result_t::err(f(err_value())); }; template @@ -68,7 +68,7 @@ inline auto maybe::result::and_then(F f) noexcept -> typename std::result_ if (is_err()) { return maybe::result::err(std::forward(err_value())); } - return f(std::forward(ok_value())); + return f(ok_value()); }; template