Add FMT_ENABLE_IF_T

for definitions of functions which declared using FMT_ENABLE_IF
This commit is contained in:
mocabe
2019-05-08 11:20:55 -07:00
committed by Victor Zverovich
parent 3fd134be03
commit 6828d549e8
4 changed files with 8 additions and 12 deletions
+4 -8
View File
@@ -376,13 +376,11 @@ struct chrono_format_checker {
FMT_NORETURN void on_tz_name() { report_no_date(); }
};
template <typename T,
typename std::enable_if<std::is_integral<T>::value, int>::type = 0>
template <typename T, FMT_ENABLE_IF(std::is_integral<T>::value)>
inline bool isnan(T) {
return false;
}
template <typename T, typename std::enable_if<std::is_floating_point<T>::value,
int>::type = 0>
template <typename T, FMT_ENABLE_IF(std::is_floating_point<T>::value)>
inline bool isnan(T value) {
return std::isnan(value);
}
@@ -394,13 +392,11 @@ template <typename T> inline int to_int(T value) {
return static_cast<int>(value);
}
template <typename T,
typename std::enable_if<std::is_integral<T>::value, int>::type = 0>
template <typename T, FMT_ENABLE_IF(std::is_integral<T>::value)>
inline T mod(T x, int y) {
return x % y;
}
template <typename T, typename std::enable_if<std::is_floating_point<T>::value,
int>::type = 0>
template <typename T, FMT_ENABLE_IF(std::is_floating_point<T>::value)>
inline T mod(T x, int y) {
return std::fmod(x, y);
}