Refactored array_size to make it always constexpr

This commit is contained in:
SChernykh
2021-10-14 16:46:49 +02:00
parent 39b2167c98
commit 9e90e988fa
5 changed files with 26 additions and 26 deletions
+1
View File
@@ -95,6 +95,7 @@ FORCEINLINE void writeVarint(T value, std::vector<uint8_t>& out)
}
template<typename T, size_t N> FORCEINLINE constexpr size_t array_size(T(&)[N]) { return N; }
template<typename T, typename U, size_t N> FORCEINLINE constexpr size_t array_size(T(U::*)[N]) { return N; }
[[noreturn]] void panic();