SFINAE differentiation between signed and unsigned
问题 I have functions for converting different arithmetic types to a half precision floating point type (just a uint16_t on the lowest level) and I have different functions for integer and floating point source types, using SFINAE and std::enable_if : template<typename T> uint16_t to_half(typename std::enable_if< std::is_floating_point<T>::value,T>::type value) { //float to half conversion } template<typename T> uint16_t to_half(typename std::enable_if< std::is_integral<T>::value,T>::type value) {