diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/error.cpp | 4 | ||||
-rw-r--r-- | src/core/error.h | 4 | ||||
-rw-r--r-- | src/core/templates.h | 2 |
3 files changed, 6 insertions, 4 deletions
diff --git a/src/core/error.cpp b/src/core/error.cpp index 7258740..ef8dc57 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_error<err::no_error>(); + return this->is_type<err::no_error>(); } bool error::is_critical() const { @@ -104,7 +104,7 @@ error_or<error::code> error_registry::search_or_register_id(const std::string_vi auto& err = err_or_id.get_error(); - if(err.is_error<err::not_found>()){ + if(err.is_type<err::not_found>()){ size_t new_index = infos.size(); if(new_index == std::numeric_limits<error::code>::max()){ return make_error<err::out_of_memory>("Error registry ids are exhausted"); diff --git a/src/core/error.h b/src/core/error.h index 2ed7cd4..32eab1e 100644 --- a/src/core/error.h +++ b/src/core/error.h @@ -48,7 +48,7 @@ public: code get_id() const; template<typename T> - bool is_error() const; + bool is_type() const; }; template<typename T> @@ -225,7 +225,7 @@ private: }; template<typename T> -bool error::is_error() const { +bool error::is_type() const { return error_code_ == impl::get_template_id<T>(); } diff --git a/src/core/templates.h b/src/core/templates.h index 9b4bcac..6c0a74e 100644 --- a/src/core/templates.h +++ b/src/core/templates.h @@ -1,5 +1,7 @@ #pragma once +#include "string_literal.h" + namespace saw { template <class T, class... TL> struct parameter_pack_index; |