mirror of
https://github.com/fmtlib/fmt.git
synced 2024-12-25 15:21:54 +00:00
Silence warnings about convering float to int
This commit is contained in:
parent
bf8636c959
commit
0e8fcd47a0
12
format.h
12
format.h
@ -781,6 +781,18 @@ class IsConvertibleToInt {
|
||||
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>
|
||||
struct EnableIf {};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user