summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/error.cpp2
-rw-r--r--src/core/templates.h17
2 files changed, 18 insertions, 1 deletions
diff --git a/src/core/error.cpp b/src/core/error.cpp
index 9520972..e777c84 100644
--- a/src/core/error.cpp
+++ b/src/core/error.cpp
@@ -32,7 +32,7 @@ const std::string_view error::get_message() const {
}
bool error::failed() const {
- return this->is_type<err::no_error>();
+ return !this->is_type<err::no_error>();
}
bool error::is_critical() const {
diff --git a/src/core/templates.h b/src/core/templates.h
index 6c0a74e..fcac61b 100644
--- a/src/core/templates.h
+++ b/src/core/templates.h
@@ -53,4 +53,21 @@ struct parameter_key_pack_index {
"Provided string_literal doesn't exist in searched list");
};
+template <size_t i, size_t s, string_literal Key0, string_literal... Keys>
+struct parameter_key_pack_type_helper {
+ static constexpr string_literal literal = parameter_key_pack_type_helper<i, s+1, Keys...>::literal;
+};
+
+template <size_t i, string_literal Key0, string_literal... Keys>
+struct parameter_key_pack_type_helper<i, i, Key0, Keys...> {
+ static constexpr string_literal literal = Key0;
+};
+
+template <size_t i, string_literal... Keys>
+struct parameter_key_pack_type {
+ static constexpr string_literal literal = parameter_key_pack_type_helper<i, 0, Keys...>::literal;
+
+ static_assert(i < sizeof...(Keys), "Provided index is too large in list");
+};
+
}