What compiler is he/she using? I cannot get this to compile at all but I might not know the magic compiler incantation to get it to work.
template<typename T>
auto length(const T& value) noexcept {
if constexpr (std::integral<T>::value) { // is number
return value;
}
else {
return value.length();
}
}