diff options
author | Dominick Allen <djallen@librehumanitas.org> | 2025-04-06 15:56:55 -0500 |
---|---|---|
committer | Dominick Allen <djallen@librehumanitas.org> | 2025-04-06 15:56:55 -0500 |
commit | 64f721d4e7d45fdf8965f641ef1ebed25cd5acc4 (patch) | |
tree | bfaeada08d9cc7149c29b92655336dea28987683 /include/fud_result.hpp | |
parent | 1f6ec08ea811c71c5b918a4bc197d319cb66abff (diff) |
Diffstat (limited to 'include/fud_result.hpp')
-rw-r--r-- | include/fud_result.hpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/fud_result.hpp b/include/fud_result.hpp index 4e08323..ad5509f 100644 --- a/include/fud_result.hpp +++ b/include/fud_result.hpp @@ -203,6 +203,12 @@ class [[nodiscard]] Result { return *std::bit_cast<const T*>(m_data.data()); } + [[nodiscard]] constexpr T& getMutOkay() & + { + fudAssert(isOkay()); + return *std::bit_cast<T*>(m_data.data()); + } + [[nodiscard]] constexpr const T& getOkayOr(const T& alternative) const& { if (!isOkay()) { |