diff --git a/luna/Result.h b/luna/Result.h index e5e99ae0..1aec130f 100644 --- a/luna/Result.h +++ b/luna/Result.h @@ -104,6 +104,13 @@ template class Result return other; } + bool try_set_value(T& ref) + { + if (!has_value()) return false; + ref = m_storage.fetch_reference(); + return true; + } + T release_value() { check(has_value());