From 8e1142f6ecac7a2549585988e59f6990d3ac4d95 Mon Sep 17 00:00:00 2001 From: hhggit Date: Thu, 20 Sep 2018 09:58:35 +0800 Subject: [PATCH] merge is_fmt_str_view into is_like_std_string --- include/fmt/ranges.h | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/include/fmt/ranges.h b/include/fmt/ranges.h index 0354ae6d..3672d4ca 100644 --- a/include/fmt/ranges.h +++ b/include/fmt/ranges.h @@ -87,6 +87,9 @@ class is_like_std_string { !std::is_void(FMT_NULL))>::value; }; +template +struct is_like_std_string> : std::true_type {}; + template struct conditional_helper {}; @@ -117,13 +120,6 @@ class is_tuple_like_ { !std::is_void(FMT_NULL))>::value; }; -template -struct is_fmt_str_view : std::false_type {}; - -template -struct is_fmt_str_view> : std::true_type { -}; - // Check for integer_sequence #if defined(__cpp_lib_integer_sequence) || FMT_MSC_VER >= 1900 template @@ -175,7 +171,6 @@ void for_each(Tuple &&tup, F &&f) { template FMT_CONSTEXPR const char* format_str_quoted(bool add_space, const Arg&, typename std::enable_if< - !is_fmt_str_view::type>::value && !is_like_std_string::type>::value>::type* = nullptr) { return add_space ? " {}" : "{}"; } @@ -183,7 +178,6 @@ FMT_CONSTEXPR const char* format_str_quoted(bool add_space, const Arg&, template FMT_CONSTEXPR const char* format_str_quoted(bool add_space, const Arg&, typename std::enable_if< - is_fmt_str_view::type>::value || is_like_std_string::type>::value>::type* = nullptr) { return add_space ? " \"{}\"" : "\"{}\""; } @@ -264,8 +258,7 @@ public: template struct is_range { static FMT_CONSTEXPR_DECL const bool value = - internal::is_range_::value && !internal::is_like_std_string::value - && !internal::is_fmt_str_view::value; + internal::is_range_::value && !internal::is_like_std_string::value; }; template