c_array_len

This commit is contained in:
Patrick 2024-07-25 10:44:55 +02:00
parent fb22b54960
commit 3b11ead3f5
1 changed files with 3 additions and 0 deletions

View File

@ -17,6 +17,9 @@
#define _EXPAND_MACRO(s) _EXPAND_STR(s)
#define _LOCATION " (at " _EXPAND_MACRO(__FILE__) ":" _EXPAND_MACRO(__LINE__) ")"
template<typename T, std::size_t N>
consteval std::size_t c_array_len(T (&arr)[N]) { return N; }
#define ADD_TYPE_HINT(type) template <> constexpr const char* const to_type_hint_str::value<type> = #type
#define TEST_FAIL(msg) ret_val_s { "", ReturnCode::FAILED, msg }