// Integral type equal
template <typename T>
typename std::enable_if<std::is_integral<T>::value, bool>::type Equal(
const T& lhs, const T& rhs) {
return lhs == rhs;
}
// Floating point type equal
template <typename T>
typename std::enable_if<std::is_floating_point<T>::value, bool>::type Equal(
const T& lhs, const T& rhs) {
return std::fabs(lhs - rhs) < std::numeric_limits<T>::epsilon();
}
标签:std,const,rhs,数值,大小,lhs,value,类型,type
From: https://www.cnblogs.com/sunwenqi/p/17576585.html