From 0e8fcd47a0248d102ad3aecae81d70b829f3014e Mon Sep 17 00:00:00 2001 From: vitaut Date: Wed, 18 Mar 2015 18:59:09 -0700 Subject: [PATCH] Silence warnings about convering float to int --- format.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/format.h b/format.h index 0a67f3f9..0cc2b564 100644 --- a/format.h +++ b/format.h @@ -781,6 +781,18 @@ class IsConvertibleToInt { enum { value = (sizeof(check(get())) == sizeof(yes)) }; }; +#define FMT_CONVERTIBLE_TO_INT(Type) \ + template <> \ + class IsConvertibleToInt { \ + 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 struct EnableIf {};