From d6b0075742735940144e8367403bc0ffd7a9a4a6 Mon Sep 17 00:00:00 2001 From: John Eivind Helset Date: Sat, 18 Jun 2022 21:43:20 +0200 Subject: [PATCH] Acknowledge char parameter. --- include/fmt/ranges.h | 27 +++++++++++++++------------ test/xchar-test.cc | 2 -- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/include/fmt/ranges.h b/include/fmt/ranges.h index f225f7be..d31b314f 100644 --- a/include/fmt/ranges.h +++ b/include/fmt/ranges.h @@ -205,20 +205,22 @@ using make_index_sequence = make_integer_sequence; template using tuple_index_sequence = make_index_sequence::value>; -template ::value> +template ::value> struct is_tuple_formattable_ { static constexpr const bool value = false; }; -template struct is_tuple_formattable_ { +template struct is_tuple_formattable_ { template - static std::true_type - check2(index_sequence,integer_sequence); - static std::false_type - check2(...); + static std::true_type check2(index_sequence, + integer_sequence); + static std::false_type check2(...); template - static decltype(check2(index_sequence{}, - integer_sequence::type>::value)...>{})) - check(index_sequence); + static decltype(check2( + index_sequence{}, + integer_sequence< + bool, (fmt::is_formattable::type, + C>::value)...>{})) + check(index_sequence); public: static constexpr const bool value = @@ -306,14 +308,15 @@ template struct is_tuple_like { detail::is_tuple_like_::value && !detail::is_range_::value; }; -template struct is_tuple_formattable { - static constexpr const bool value = detail::is_tuple_formattable_::value; +template struct is_tuple_formattable { + static constexpr const bool value = + detail::is_tuple_formattable_::value; }; template struct formatter::value && - fmt::is_tuple_formattable::value>> { + fmt::is_tuple_formattable::value>> { private: // C++11 generic lambda for format(). template struct format_each { diff --git a/test/xchar-test.cc b/test/xchar-test.cc index 95a9c0bd..498ff651 100644 --- a/test/xchar-test.cc +++ b/test/xchar-test.cc @@ -315,12 +315,10 @@ TEST(xchar_test, ostream) { #endif } -#ifdef FMT_XCHAR_TEST_ENABLE_FORMAT_MAP TEST(xchar_test, format_map) { auto m = std::map{{L"one", 1}, {L"t\"wo", 2}}; EXPECT_EQ(fmt::format(L"{}", m), L"{\"one\": 1, \"t\\\"wo\": 2}"); } -#endif TEST(xchar_test, escape_string) { using vec = std::vector;