--amend
All checks were successful
linux-x64-gcc / linux-gcc (Debug) (push) Successful in 1m44s
linux-x64-gcc / linux-gcc (Release) (push) Successful in 3m32s

This commit is contained in:
tqcq 2024-03-18 16:43:30 +08:00
parent 8227f8f589
commit 0544a85b94

View File

@ -107,25 +107,25 @@ public:
T &value_or(T &&val) & T &value_or(T &&val) &
{ {
if (!ok()) return val; if (!ok()) return std::forward<T>(val);
return **this; return **this;
} }
T const &value_or(T &&val) const & T const &value_or(T &&val) const &
{ {
if (!ok()) return val; if (!ok()) return std::forward<T>(val);
return **this; return **this;
} }
T &&value_or(T &&val) && T &&value_or(T &&val) &&
{ {
if (!ok()) return val; if (!ok()) return std::forward<T>(val);
return std::move(**this); return std::move(**this);
} }
T const &&value_or(T &&val) const && T const &&value_or(T &&val) const &&
{ {
if (!ok()) return val; if (!ok()) return std::forward<T>(val);
return std::move(**this); return std::move(**this);
} }