forked from fmtlib/fmt
Silence warnings about convering float to int
This commit is contained in:
12
format.h
12
format.h
@@ -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 {};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user