[ox] Cleanup

This commit is contained in:
2024-05-08 23:35:05 -05:00
parent 47a6a410c4
commit 63486c23d4
20 changed files with 195 additions and 117 deletions

View File

@ -234,6 +234,22 @@ struct [[nodiscard]] Result {
return value;
}
template<typename U = T>
constexpr ox::Result<U> to() & noexcept {
if (error) [[unlikely]] {
return error;
}
return U(value);
}
template<typename U = T>
constexpr ox::Result<U> to() && noexcept {
if (error) [[unlikely]] {
return error;
}
return U(std::move(value));
}
template<typename U = T>
constexpr ox::Result<U> to(auto const&f) & noexcept {
if (error) [[unlikely]] {