Get rid of FMT_ENABLE_IF_T

by adding parentheses on each definition.
This commit is contained in:
mocabe 2019-06-03 23:16:18 +09:00
parent fd9f1bff44
commit 3d22a1effc
3 changed files with 4 additions and 4 deletions

View File

@ -207,8 +207,7 @@ using enable_if_t = typename std::enable_if<B, T>::type;
// enable_if helpers to be used in template parameters which results in much // enable_if helpers to be used in template parameters which results in much
// shorter symbols: https://godbolt.org/z/sWw4vP. // shorter symbols: https://godbolt.org/z/sWw4vP.
// Also include fix for VS2019 compilation issue (see #1140 and #1186). // Also include fix for VS2019 compilation issue (see #1140 and #1186).
#define FMT_ENABLE_IF_T(...) enable_if_t<(__VA_ARGS__), int> #define FMT_ENABLE_IF(...) enable_if_t<(__VA_ARGS__), int> = 0
#define FMT_ENABLE_IF(...) FMT_ENABLE_IF_T(__VA_ARGS__) = 0
namespace internal { namespace internal {

View File

@ -674,7 +674,8 @@ template <int GRISU_VERSION> struct grisu_shortest_handler {
} }
}; };
template <typename Double, FMT_ENABLE_IF_T(sizeof(Double) == sizeof(uint64_t))> template <typename Double,
enable_if_t<(sizeof(Double) == sizeof(uint64_t)), int>>
FMT_API bool grisu_format(Double value, buffer<char>& buf, int precision, FMT_API bool grisu_format(Double value, buffer<char>& buf, int precision,
unsigned options, int& exp) { unsigned options, int& exp) {
FMT_ASSERT(value >= 0, "value is negative"); FMT_ASSERT(value >= 0, "value is negative");

View File

@ -2246,7 +2246,7 @@ FMT_CONSTEXPR bool do_check_format_string(basic_string_view<Char> s,
} }
template <typename... Args, typename S, template <typename... Args, typename S,
FMT_ENABLE_IF_T(is_compile_string<S>::value)> enable_if_t<(is_compile_string<S>::value), int>>
void check_format_string(S format_str) { void check_format_string(S format_str) {
typedef typename S::char_type char_t; typedef typename S::char_type char_t;
FMT_CONSTEXPR_DECL bool invalid_format = FMT_CONSTEXPR_DECL bool invalid_format =