integral_constant -> bool_constant

This commit is contained in:
Victor Zverovich
2019-06-05 08:14:47 -07:00
parent 7e39c7e6f4
commit 388bb389e6
2 changed files with 8 additions and 11 deletions

View File

@ -400,7 +400,7 @@ using fmt::v5::to_string_view;
// Specifies whether S is a string type convertible to fmt::basic_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 // 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 <typename S> template <typename S>
struct is_string struct is_string
: bool_constant< : bool_constant<
@ -483,9 +483,8 @@ struct formatter {
}; };
template <typename T, typename Char, typename Enable = void> template <typename T, typename Char, typename Enable = void>
struct convert_to_int struct convert_to_int : bool_constant<!std::is_arithmetic<T>::value &&
: std::integral_constant<bool, !std::is_arithmetic<T>::value && std::is_convertible<T, int>::value> {};
std::is_convertible<T, int>::value> {};
namespace internal { namespace internal {

View File

@ -780,10 +780,10 @@ inline char8_t to_char8_t(char c) { return static_cast<char8_t>(c); }
template <typename InputIt, typename OutChar> template <typename InputIt, typename OutChar>
struct needs_conversion struct needs_conversion
: std::integral_constant< : bool_constant<
bool, std::is_same<typename std::iterator_traits<InputIt>::value_type, std::is_same<typename std::iterator_traits<InputIt>::value_type,
char>::value && char>::value &&
std::is_same<OutChar, char8_t>::value> {}; std::is_same<OutChar, char8_t>::value> {};
template <typename OutChar, typename InputIt, typename OutputIt, template <typename OutChar, typename InputIt, typename OutputIt,
FMT_ENABLE_IF(!needs_conversion<InputIt, OutChar>::value)> FMT_ENABLE_IF(!needs_conversion<InputIt, OutChar>::value)>
@ -2261,9 +2261,7 @@ void check_format_string(S format_str) {
// It is not possible to use get_type in formatter specialization directly // It is not possible to use get_type in formatter specialization directly
// because of a bug in MSVC. // because of a bug in MSVC.
template <typename Context, typename T> template <typename Context, typename T>
struct format_type using format_type = bool_constant<get_type<Context, T>::value != custom_type>;
: std::integral_constant<bool, get_type<Context, T>::value != custom_type> {
};
template <template <typename> class Handler, typename Spec, typename Context> template <template <typename> class Handler, typename Spec, typename Context>
void handle_dynamic_spec(Spec& value, arg_ref<typename Context::char_type> ref, void handle_dynamic_spec(Spec& value, arg_ref<typename Context::char_type> ref,