From 3b11ead3f5ca6ad2ea45c9004d8008a5e2621b8a Mon Sep 17 00:00:00 2001 From: Patrick Date: Thu, 25 Jul 2024 10:44:55 +0200 Subject: [PATCH] c_array_len --- test/common_helper/test.hpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/common_helper/test.hpp b/test/common_helper/test.hpp index 87709fd..8e0a323 100644 --- a/test/common_helper/test.hpp +++ b/test/common_helper/test.hpp @@ -17,6 +17,9 @@ #define _EXPAND_MACRO(s) _EXPAND_STR(s) #define _LOCATION " (at " _EXPAND_MACRO(__FILE__) ":" _EXPAND_MACRO(__LINE__) ")" +template +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 #define TEST_FAIL(msg) ret_val_s { "", ReturnCode::FAILED, msg }