https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92693
--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> --- (In reply to Matthijs Kooijman from comment #3) > Fair point, though I think that it is hard to define a proper overload set > here. In my case, I'm defining functions to print various sizes of integers. > Because the body of the function needs to know how big the type is, I'm > using the > uintxx_t types to define them. I could of course define the function for > (unsigned) char, short, int, long, long long, but then I can't make any > assumptions about the exact size of each (I could use sizeof and make a > generic implementation, but I wanted to keep things simple and use a > different implementation for each size). void func(uint8_t); void func(uint16_t); void func(uint32_t); void func(uint64_t); template<typename T> std::enable_if_t<std::is_unsigned<T>::value> func(T t) { if (sizeof(T) == sizeof(uint8_t)) func((uint8_t)t); else if (sizeof(T) == sizeof(uint16_t)) func((uint16_t)t); else if (sizeof(T) == sizeof(uint32_t)) func((uint32_t)t); else if (sizeof(T) == sizeof(uint64_t)) func((uint64_t)t); }