From 388bb389e6c024745b230ba4bffa350a8227d0e0 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Wed, 5 Jun 2019 08:14:47 -0700 Subject: [PATCH] integral_constant -> bool_constant --- include/fmt/core.h | 7 +++---- include/fmt/format.h | 12 +++++------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/include/fmt/core.h b/include/fmt/core.h index 439e70bf..0e53728e 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -400,7 +400,7 @@ using fmt::v5::to_string_view; // Specifies whether S is a string type convertible to fmt::basic_string_view. // It should be a constexpr function but MSVC 2017 fails to compile it in -// enable_if. +// enable_if. MSVC 2015 fails to compile it as an alias template. template struct is_string : bool_constant< @@ -483,9 +483,8 @@ struct formatter { }; template -struct convert_to_int - : std::integral_constant::value && - std::is_convertible::value> {}; +struct convert_to_int : bool_constant::value && + std::is_convertible::value> {}; namespace internal { diff --git a/include/fmt/format.h b/include/fmt/format.h index 18bccaa3..15ac5ac1 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -780,10 +780,10 @@ inline char8_t to_char8_t(char c) { return static_cast(c); } template struct needs_conversion - : std::integral_constant< - bool, std::is_same::value_type, - char>::value && - std::is_same::value> {}; + : bool_constant< + std::is_same::value_type, + char>::value && + std::is_same::value> {}; template ::value)> @@ -2261,9 +2261,7 @@ void check_format_string(S format_str) { // It is not possible to use get_type in formatter specialization directly // because of a bug in MSVC. template -struct format_type - : std::integral_constant::value != custom_type> { -}; +using format_type = bool_constant::value != custom_type>; template