From 2dd0ce8964c8218204cb15f6491e6f12c290447f Mon Sep 17 00:00:00 2001 From: tqcq <99722391+tqcq@users.noreply.github.com> Date: Mon, 18 Mar 2024 16:56:27 +0800 Subject: [PATCH] fix status_or return value_or --- include/sled/status_or.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/sled/status_or.h b/include/sled/status_or.h index 834fb8a..cfa60c2 100644 --- a/include/sled/status_or.h +++ b/include/sled/status_or.h @@ -107,13 +107,13 @@ public: T &value_or(T &&val) & { - if (!ok()) return std::forward(val); + if (!ok()) return val; return **this; } T const &value_or(T &&val) const & { - if (!ok()) return std::forward(val); + if (!ok()) return val; return **this; }