37 template<
typename Callback,
typename Ret_TYPE,
typename ...Args_TYPE>
50 class error :
public std::exception{};
70 template<
typename ERR, const
bool TRIGGERING_CONDITION>
74 static_assert(!TRIGGERING_CONDITION);
86 [[nodiscard]]
auto what()
const noexcept ->
const char*
override
88 return "Out of the bound of the object.";
99 [[nodiscard]]
auto what()
const noexcept ->
const char*
override
101 return "Wrong value given.";
112 [[nodiscard]]
auto what()
const noexcept ->
const char*
override
114 return "Attempting to access null pointer.";
125 [[nodiscard]]
auto what()
const noexcept ->
const char*
override
127 return "Unsupported Method for class.";
138 [[nodiscard]]
auto what()
const noexcept ->
const char*
override
140 return "No such element.";
151 [[nodiscard]]
auto what()
const noexcept ->
const char*
override
153 return "Callback signature mismatch.";
164 [[nodiscard]]
auto what()
const noexcept ->
const char*
override
166 return "Return type of callback mismatch.";
186 [[nodiscard]]
auto what()
const noexcept ->
const char*
override
188 return "Can not allocate memory.";
195 [[nodiscard]]
auto what()
const noexcept ->
const char*
override
197 return "A sys error triggered.";
205template<
typename Callback,
typename Ret_TYPE,
typename... Args_TYPE>
207 if constexpr (
constexpr bool is_valid = std::is_invocable_v<Callback, Args_TYPE...>;
211 using result_type = std::invoke_result_t<Callback, Args_TYPE...>;
212 if constexpr (
constexpr bool is_valid_return_type = std::is_same_v<result_type, Ret_TYPE>;
213 !is_valid_return_type)
218template <const
bool TRIGGERING_CONDITION>
221 static_assert(!TRIGGERING_CONDITION,
"A static assert triggered");
224template <const
bool TRIGGERING_CONDITION>
227 static_assert(!TRIGGERING_CONDITION,
"Out of the bound of the object");
230template <const
bool TRIGGERING_CONDITION>
233 static_assert(!TRIGGERING_CONDITION,
"Wrong value given");
236template <const
bool TRIGGERING_CONDITION>
239 static_assert(!TRIGGERING_CONDITION,
"Attempting to access null pointer");
242template <const
bool TRIGGERING_CONDITION>
245 static_assert(!TRIGGERING_CONDITION,
"Unsupported Method for class");
248template <const
bool TRIGGERING_CONDITION>
251 static_assert(!TRIGGERING_CONDITION,
"No such element");
254template <const
bool TRIGGERING_CONDITION>
257 static_assert(!TRIGGERING_CONDITION,
"Return type of callback mismatch");
260template <const
bool TRIGGERING_CONDITION>
263 static_assert(!TRIGGERING_CONDITION,
"Callback signature mismatch");
266template <const
bool TRIGGERING_CONDITION>
269 static_assert(!TRIGGERING_CONDITION,
"Can not allocate memory");
Exception for memory allocation failures.
Definition error.h:184
Static utility for validating callback signatures.
Definition error.h:21
static void check()
Validates a callback's signature and return type.
Definition error.h:206
Exception for callback return type mismatch.
Definition error.h:162
Exception for callback argument mismatch.
Definition error.h:149
Base interface for all exception types in Original.
Definition error.h:50
Exception for missing element requests.
Definition error.h:136
Exception for null pointer dereference attempts.
Definition error.h:110
Exception for container index out-of-range errors.
Definition error.h:84
Compile-time error assertion utility.
Definition error.h:73
Exception for unimplemented method calls.
Definition error.h:123
Exception for invalid parameter values.
Definition error.h:97
Checks derivation or type identity.
Definition types.h:173
Main namespace for the project Original.
Definition algorithms.h:21
Core type system foundations and concept definitions.