Skip to content

Commit

Permalink
Run clang-format on changed files
Browse files Browse the repository at this point in the history
  • Loading branch information
Arghnews committed May 1, 2024
1 parent d7b2646 commit 1aaf2a0
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 20 deletions.
33 changes: 17 additions & 16 deletions include/fmt/ranges.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,12 @@ template <typename T, typename C> class is_tuple_formattable_<T, C, true> {
static auto all_true(...) -> std::false_type;

template <size_t... Is>
static auto check(index_sequence<Is...>) -> decltype(all_true(
index_sequence<Is...>{},
integer_sequence<bool,
(is_formattable<typename std::tuple_element<Is, T>::type,
C>::value)...>{}));
static auto check(index_sequence<Is...>)
-> decltype(all_true(
index_sequence<Is...>{},
integer_sequence<
bool, (is_formattable<typename std::tuple_element<Is, T>::type,
C>::value)...>{}));

public:
static constexpr const bool value =
Expand Down Expand Up @@ -324,8 +325,8 @@ struct formatter<Tuple, Char,
}

template <typename FormatContext>
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<Char>(opening_bracket_, ctx.out()));
detail::for_each2(
formatters_, value,
Expand Down Expand Up @@ -541,8 +542,8 @@ struct range_default_formatter<
}

template <typename FormatContext>
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);
}
};
Expand Down Expand Up @@ -664,9 +665,9 @@ auto join(It begin, Sentinel end, string_view sep) -> join_view<It, Sentinel> {
\endrst
*/
template <typename Range>
auto join(Range&& r, string_view sep)
-> join_view<decltype(detail::range_begin(r)),
decltype(detail::range_end(r))> {
auto join(Range&& r,
string_view sep) -> join_view<decltype(detail::range_begin(r)),
decltype(detail::range_end(r))> {
return {detail::range_begin(r), detail::range_end(r), sep};
}

Expand Down Expand Up @@ -797,8 +798,8 @@ FMT_BEGIN_EXPORT
\endrst
*/
template <typename... T>
FMT_CONSTEXPR auto join(const std::tuple<T...>& tuple, string_view sep)
-> tuple_join_view<char, T...> {
FMT_CONSTEXPR auto join(const std::tuple<T...>& tuple,
string_view sep) -> tuple_join_view<char, T...> {
return {tuple, sep};
}

Expand All @@ -814,8 +815,8 @@ FMT_CONSTEXPR auto join(const std::tuple<T...>& tuple, string_view sep)
\endrst
*/
template <typename T>
auto join(std::initializer_list<T> list, string_view sep)
-> join_view<const T*, const T*> {
auto join(std::initializer_list<T> list,
string_view sep) -> join_view<const T*, const T*> {
return join(std::begin(list), std::end(list), sep);
}

Expand Down
8 changes: 4 additions & 4 deletions test/ranges-test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ struct bad_format {};
FMT_BEGIN_NAMESPACE
template <> struct formatter<not_default_formattable> {
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();
}
};
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 1aaf2a0

Please sign in to comment.