Silence warnings about convering float to int

This commit is contained in:
vitaut 2015-03-18 18:59:09 -07:00
parent bf8636c959
commit 0e8fcd47a0

View File

@ -781,6 +781,18 @@ class IsConvertibleToInt {
enum { value = (sizeof(check(get())) == sizeof(yes)) }; enum { value = (sizeof(check(get())) == sizeof(yes)) };
}; };
#define FMT_CONVERTIBLE_TO_INT(Type) \
template <> \
class IsConvertibleToInt<Type> { \
public: \
enum { value = 1 }; \
}
// Silence warnings about convering float to int.
FMT_CONVERTIBLE_TO_INT(float);
FMT_CONVERTIBLE_TO_INT(double);
FMT_CONVERTIBLE_TO_INT(long double);
template<bool B, class T = void> template<bool B, class T = void>
struct EnableIf {}; struct EnableIf {};