Skip to content

Commit

Permalink
Silence warnings about convering float to int
Browse files Browse the repository at this point in the history
vitaut committed Mar 19, 2015

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent bf8636c commit 0e8fcd4
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions format.h
Original file line number Diff line number Diff line change
@@ -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 {};

0 comments on commit 0e8fcd4

Please sign in to comment.