diff --git a/include/fmt/core.h b/include/fmt/core.h index 8df1f8aa..a733e4ef 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -187,11 +187,6 @@ # define FMT_ASSERT(condition, message) assert((condition) && message) #endif -// An enable_if helper to be used in template parameters. enable_if in template -// parameters results in much shorter symbols: https://godbolt.org/z/sWw4vP. -#define FMT_ENABLE_IF_T(...) typename std::enable_if<(__VA_ARGS__), int>::type -#define FMT_ENABLE_IF(...) FMT_ENABLE_IF_T(__VA_ARGS__) = 0 - // libc++ supports string_view in pre-c++17. #if (FMT_HAS_INCLUDE() && \ (__cplusplus > 201402L || defined(_LIBCPP_VERSION))) || \ @@ -215,6 +210,11 @@ using std_string_view = std::experimental::basic_string_view; template struct std_string_view {}; #endif +// An enable_if helper to be used in template parameters. enable_if in template +// parameters results in much shorter symbols: https://godbolt.org/z/sWw4vP. +template using enable_if_t = typename std::enable_if::type; +#define FMT_ENABLE_IF(...) internal::enable_if_t<__VA_ARGS__> = 0 + #if (__cplusplus >= 201703L || \ (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)) && \ __cpp_lib_is_invocable >= 201703L diff --git a/include/fmt/format-inl.h b/include/fmt/format-inl.h index 6c6f5223..8f9d58f7 100644 --- a/include/fmt/format-inl.h +++ b/include/fmt/format-inl.h @@ -223,7 +223,7 @@ template Locale locale_ref::get() const { } template FMT_FUNC Char thousands_sep_impl(locale_ref loc) { - return std::use_facet >(loc.get()) + return std::use_facet>(loc.get()) .thousands_sep(); } } // namespace internal @@ -683,7 +683,7 @@ template struct grisu_shortest_handler { } }; -template +template > FMT_API bool grisu_format(Double value, buffer& buf, int precision, unsigned options, int& exp) { FMT_ASSERT(value >= 0, "value is negative"); diff --git a/include/fmt/format.h b/include/fmt/format.h index 5fb25eb3..72be49bc 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -2238,7 +2238,7 @@ FMT_CONSTEXPR bool do_check_format_string(basic_string_view s, } template ::value)> + internal::enable_if_t::value>> void check_format_string(S format_str) { typedef typename S::char_type char_t; FMT_CONSTEXPR_DECL bool invalid_format =