summaryrefslogtreecommitdiff
path: root/modules/core
diff options
context:
space:
mode:
Diffstat (limited to 'modules/core')
-rw-r--r--modules/core/c++/error.hpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/modules/core/c++/error.hpp b/modules/core/c++/error.hpp
index ac45fbc..32b67a0 100644
--- a/modules/core/c++/error.hpp
+++ b/modules/core/c++/error.hpp
@@ -270,33 +270,33 @@ private:
"Don't use internal private types");
public:
- error_or():value_or_error_{make_error<err::invalid_state>("Default assignement for error_or constructor.")}{}
- error_or(const fix_void<T> &value) : value_or_error_{value} {}
+ constexpr error_or():value_or_error_{make_error<err::invalid_state>("Default assignement for error_or constructor.")}{}
+ constexpr error_or(const fix_void<T> &value) : value_or_error_{value} {}
- error_or(fix_void<T> &&value) : value_or_error_{std::move(value)} {}
+ constexpr error_or(fix_void<T> &&value) : value_or_error_{std::move(value)} {}
- error_or(const error &error) : value_or_error_{error} {}
- error_or(error &&error) : value_or_error_{std::move(error)} {}
+ constexpr error_or(const error &error) : value_or_error_{error} {}
+ constexpr error_or(error &&error) : value_or_error_{std::move(error)} {}
- bool is_value() const {
+ constexpr bool is_value() const {
return std::holds_alternative<fix_void<T>>(value_or_error_);
}
- bool is_error() const {
+ constexpr bool is_error() const {
return std::holds_alternative<class error>(value_or_error_);
}
- class error &get_error() {
+ constexpr class error &get_error() {
return std::get<class error>(value_or_error_);
}
- const class error &get_error() const {
+ constexpr const class error &get_error() const {
return std::get<class error>(value_or_error_);
}
- fix_void<T> &get_value() { return std::get<fix_void<T>>(value_or_error_); }
+ constexpr fix_void<T> &get_value() { return std::get<fix_void<T>>(value_or_error_); }
- const fix_void<T> &get_value() const {
+ constexpr const fix_void<T> &get_value() const {
return std::get<fix_void<T>>(value_or_error_);
}
};