diff --git a/src/common/utils/string.hpp b/src/common/utils/string.hpp index 44c8d01..2757d2e 100644 --- a/src/common/utils/string.hpp +++ b/src/common/utils/string.hpp @@ -2,10 +2,8 @@ #include "memory.hpp" #include -#ifndef ARRAYSIZE template -size_t ARRAYSIZE(Type (&)[n]) { return n; } -#endif +constexpr auto ARRAY_COUNT(Type(&)[n]) { return n; } namespace utils::string { @@ -21,7 +19,7 @@ namespace utils::string char* get(const char* format, const va_list ap) { - ++this->current_buffer_ %= ARRAYSIZE(this->string_pool_); + ++this->current_buffer_ %= ARRAY_COUNT(this->string_pool_); auto entry = &this->string_pool_[this->current_buffer_]; if (!entry->size || !entry->buffer)