From b528976178b5aa70581cc1616c6695ba4740893a Mon Sep 17 00:00:00 2001 From: ThePhD Date: Fri, 15 Dec 2023 20:27:49 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20clang-format=20affected=20files!?= =?UTF-8?q?=20(with=20the=20right=20clang-format=2017.0.x,=20rather=20than?= =?UTF-8?q?=2016.0.x)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/fmt/color.h | 7 ++++--- include/fmt/format.h | 22 +++++++++++----------- include/fmt/xchar.h | 40 +++++++++++++++++++++------------------- 3 files changed, 36 insertions(+), 33 deletions(-) diff --git a/include/fmt/color.h b/include/fmt/color.h index 99a8e1ee..b203e9ac 100644 --- a/include/fmt/color.h +++ b/include/fmt/color.h @@ -643,9 +643,10 @@ OutputIt vformat_to( fmt::emphasis::bold | fg(fmt::color::red), "{}", 42); \endrst */ -template >::value&& - detail::is_string::value> +template < + typename OutputIt, typename S, typename... Args, + bool enable = detail::is_output_iterator>::value && + detail::is_string::value> inline auto format_to(OutputIt out, const text_style& ts, const S& format_str, Args&&... args) -> typename std::enable_if::type { diff --git a/include/fmt/format.h b/include/fmt/format.h index 0bbefadb..4400ae57 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -1161,10 +1161,10 @@ using uint32_or_64_or_128_t = template using uint64_or_128_t = conditional_t() <= 64, uint64_t, uint128_t>; -#define FMT_POWERS_OF_10(factor) \ - factor * 10, (factor)*100, (factor)*1000, (factor)*10000, (factor)*100000, \ - (factor)*1000000, (factor)*10000000, (factor)*100000000, \ - (factor)*1000000000 +#define FMT_POWERS_OF_10(factor) \ + factor * 10, (factor) * 100, (factor) * 1000, (factor) * 10000, \ + (factor) * 100000, (factor) * 1000000, (factor) * 10000000, \ + (factor) * 100000000, (factor) * 1000000000 // Converts value in the range [0, 100) to a string. constexpr const char* digits2(size_t value) { @@ -2123,7 +2123,7 @@ template auto write_int(OutputIt out, UInt value, unsigned prefix, const format_specs& specs, const digit_grouping& grouping) -> OutputIt { - static_assert(std::is_same, UInt>::value, ""); + static_assert(std::is_same, UInt>::value, ""); int num_digits = 0; auto buffer = memory_buffer(); switch (specs.type) { @@ -2139,7 +2139,7 @@ auto write_int(OutputIt out, UInt value, unsigned prefix, if (specs.alt) prefix_append(prefix, unsigned(upper ? 'X' : 'x') << 8 | '0'); num_digits = count_digits<4>(value); - format_uint<4,Char>(appender(buffer), value, num_digits, upper); + format_uint<4, Char>(appender(buffer), value, num_digits, upper); break; } case presentation_type::bin_lower: @@ -2148,7 +2148,7 @@ auto write_int(OutputIt out, UInt value, unsigned prefix, if (specs.alt) prefix_append(prefix, unsigned(upper ? 'B' : 'b') << 8 | '0'); num_digits = count_digits<1>(value); - format_uint<1,Char>(appender(buffer), value, num_digits); + format_uint<1, Char>(appender(buffer), value, num_digits); break; } case presentation_type::oct: { @@ -2157,7 +2157,7 @@ auto write_int(OutputIt out, UInt value, unsigned prefix, // is not greater than the number of digits. if (specs.alt && specs.precision <= num_digits && value != 0) prefix_append(prefix, '0'); - format_uint<3,Char>(appender(buffer), value, num_digits); + format_uint<3, Char>(appender(buffer), value, num_digits); break; } case presentation_type::chr: @@ -2167,11 +2167,11 @@ auto write_int(OutputIt out, UInt value, unsigned prefix, } unsigned size = (prefix != 0 ? prefix >> 24 : 0) + to_unsigned(num_digits) + - to_unsigned(grouping.count_separators(num_digits)); + to_unsigned(grouping.count_separators(num_digits)); return write_padded( out, specs, size, size, [&](reserve_iterator it) { - for (unsigned p = prefix & 0xffffff; p != 0; p >>= 8) - *it++ = static_cast(p & 0xff); + for (unsigned p = prefix & 0xffffff; p != 0; p >>= 8) + *it++ = static_cast(p & 0xff); return grouping.apply(it, string_view(buffer.data(), buffer.size())); }); } diff --git a/include/fmt/xchar.h b/include/fmt/xchar.h index 8943b408..740cdb73 100644 --- a/include/fmt/xchar.h +++ b/include/fmt/xchar.h @@ -216,13 +216,14 @@ inline auto vformat_into( return detail::get_iterator(buf, out); } -template < - typename Output, typename Locale, typename S, typename... T, - typename Char = char_t, - bool enable = (std::ranges::output_range || - std::output_iterator, Char>)&&detail:: - is_locale::value&& detail::is_exotic_char::value, - FMT_ENABLE_IF(enable)> +template , + bool enable = + (std::ranges::output_range || + std::output_iterator, + Char>)&&detail::is_locale::value && + detail::is_exotic_char::value, + FMT_ENABLE_IF(enable)> inline auto format_to(Output&& out, const Locale& loc, const S& format_str, T&&... args) { return vformat_to(std::forward(out), loc, @@ -230,13 +231,14 @@ inline auto format_to(Output&& out, const Locale& loc, const S& format_str, fmt::make_format_args>(args...)); } -template < - typename Output, typename Locale, typename S, typename... T, - typename Char = char_t, - bool enable = (std::ranges::output_range || - std::output_iterator, Char>)&&detail:: - is_locale::value&& detail::is_exotic_char::value, - FMT_ENABLE_IF(enable)> +template , + bool enable = + (std::ranges::output_range || + std::output_iterator, + Char>)&&detail::is_locale::value && + detail::is_exotic_char::value, + FMT_ENABLE_IF(enable)> inline auto format_into(Output&& out, const Locale& loc, const S& format_str, T&&... args) { return vformat_into(std::forward(out), loc, @@ -278,11 +280,11 @@ inline auto vformat_to( return detail::get_iterator(buf, out); } -template < - typename OutputIt, typename Locale, typename S, typename... T, - typename Char = char_t, - bool enable = detail::is_output_iterator::value&& - detail::is_locale::value&& detail::is_exotic_char::value> +template , + bool enable = detail::is_output_iterator::value && + detail::is_locale::value && + detail::is_exotic_char::value> inline auto format_to(OutputIt out, const Locale& loc, const S& format_str, T&&... args) -> typename std::enable_if::type {