From 1aaf2a09f3d334479e996159fdbd55d9af9c0303 Mon Sep 17 00:00:00 2001 From: Justin Riddell Date: Wed, 1 May 2024 04:07:40 +0100 Subject: [PATCH] Run clang-format on changed files --- include/fmt/ranges.h | 33 +++++++++++++++++---------------- test/ranges-test.cc | 8 ++++---- 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/include/fmt/ranges.h b/include/fmt/ranges.h index 8a1132372bd0d..a14b715b3dc8f 100644 --- a/include/fmt/ranges.h +++ b/include/fmt/ranges.h @@ -172,11 +172,12 @@ template class is_tuple_formattable_ { static auto all_true(...) -> std::false_type; template - static auto check(index_sequence) -> decltype(all_true( - index_sequence{}, - integer_sequence::type, - C>::value)...>{})); + static auto check(index_sequence) + -> decltype(all_true( + index_sequence{}, + integer_sequence< + bool, (is_formattable::type, + C>::value)...>{})); public: static constexpr const bool value = @@ -324,8 +325,8 @@ struct formatter - auto format(const Tuple& value, FormatContext& ctx) const - -> decltype(ctx.out()) { + auto format(const Tuple& value, + FormatContext& ctx) const -> decltype(ctx.out()) { ctx.advance_to(detail::copy(opening_bracket_, ctx.out())); detail::for_each2( formatters_, value, @@ -541,8 +542,8 @@ struct range_default_formatter< } template - auto format(range_type& range, FormatContext& ctx) const - -> decltype(ctx.out()) { + auto format(range_type& range, + FormatContext& ctx) const -> decltype(ctx.out()) { return underlying_.format(range, ctx); } }; @@ -664,9 +665,9 @@ auto join(It begin, Sentinel end, string_view sep) -> join_view { \endrst */ template -auto join(Range&& r, string_view sep) - -> join_view { +auto join(Range&& r, + string_view sep) -> join_view { return {detail::range_begin(r), detail::range_end(r), sep}; } @@ -797,8 +798,8 @@ FMT_BEGIN_EXPORT \endrst */ template -FMT_CONSTEXPR auto join(const std::tuple& tuple, string_view sep) - -> tuple_join_view { +FMT_CONSTEXPR auto join(const std::tuple& tuple, + string_view sep) -> tuple_join_view { return {tuple, sep}; } @@ -814,8 +815,8 @@ FMT_CONSTEXPR auto join(const std::tuple& tuple, string_view sep) \endrst */ template -auto join(std::initializer_list list, string_view sep) - -> join_view { +auto join(std::initializer_list list, + string_view sep) -> join_view { return join(std::begin(list), std::end(list), sep); } diff --git a/test/ranges-test.cc b/test/ranges-test.cc index b977bf22bb6d9..b47c1d7998d17 100644 --- a/test/ranges-test.cc +++ b/test/ranges-test.cc @@ -167,8 +167,8 @@ struct bad_format {}; FMT_BEGIN_NAMESPACE template <> struct formatter { auto parse(format_parse_context&) -> const char* { throw bad_format(); } - auto format(not_default_formattable, format_context& ctx) - -> format_context::iterator { + auto format(not_default_formattable, + format_context& ctx) -> format_context::iterator { return ctx.out(); } }; @@ -468,7 +468,7 @@ struct vec { auto begin(const vec& v) -> const int* { return v.n; } auto end(const vec& v) -> const int* { return v.n + 2; } -} +} // namespace adl TEST(ranges_test, format_join_adl_begin_end) { EXPECT_EQ(fmt::format("{}", fmt::join(adl::vec(), "/")), "42/43"); @@ -629,7 +629,7 @@ TEST(ranges_test, lvalue_qualified_begin_end) { #elif FMT_CLANG_VERSION # if FMT_CLANG_VERSION > 1500 # define ENABLE_INPUT_RANGE_JOIN_TEST 1 -#else +# else # define ENABLE_INPUT_RANGE_JOIN_TEST 0 # endif #else