Код: Выделить всё
constexpr size_t my_strlen(const char* s)
{
const char* cp = s;
while(*cp != '\0') { cp++; };
return cp - s;
}
Код: Выделить всё
template
constexpr auto type_name_length = my_strlen(typeid(T).name());
Подробнее здесь: https://stackoverflow.com/questions/359 ... onstexprly
Мобильная версия