Added XML support; #21

This commit is contained in:
Patrick Urbanke
2023-12-20 21:07:36 +01:00
parent 2281849dde
commit c5347eee28
124 changed files with 4652 additions and 1437 deletions
+5 -5
View File
@@ -309,13 +309,13 @@ class Result {
}
/// Returns the value or a default.
T value_or(const T& _default) noexcept {
const auto handle_variant =
[&]<class TOrError>(const TOrError& _t_or_err) -> T {
if constexpr (!std::is_same<TOrError, Error>()) {
T value_or(T&& _default) noexcept {
const auto handle_variant = [&]<class TOrError>(TOrError&& _t_or_err) -> T {
using Type = std::decay_t<TOrError>;
if constexpr (!std::is_same<Type, Error>()) {
return std::forward<T>(_t_or_err);
} else {
return _default;
return std::forward<T>(_default);
}
};
return std::visit(handle_variant, t_or_err_);