From 507c3042d8d86bb80ef381bdc68ee0957a6ec52f Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Sat, 18 Feb 2023 10:23:42 -0800 Subject: [PATCH] class -> typename --- include/fmt/chrono.h | 2 +- include/fmt/format-inl.h | 9 +++++---- include/fmt/format.h | 2 +- include/fmt/ostream.h | 2 +- include/fmt/ranges.h | 8 ++++---- 5 files changed, 12 insertions(+), 11 deletions(-) diff --git a/include/fmt/chrono.h b/include/fmt/chrono.h index 815ff9ed..ec0b1e7b 100644 --- a/include/fmt/chrono.h +++ b/include/fmt/chrono.h @@ -504,7 +504,7 @@ inline std::tm localtime(std::time_t time) { } #if FMT_USE_LOCAL_TIME -template +template inline auto localtime(std::chrono::local_time time) -> std::tm { return localtime(std::chrono::system_clock::to_time_t( std::chrono::current_zone()->to_sys(time))); diff --git a/include/fmt/format-inl.h b/include/fmt/format-inl.h index 3b00bd67..ba1ab462 100644 --- a/include/fmt/format-inl.h +++ b/include/fmt/format-inl.h @@ -257,7 +257,7 @@ inline uint64_t divide_by_10_to_kappa_plus_1(uint64_t n) noexcept { } // Various subroutines using pow10 cache -template struct cache_accessor; +template struct cache_accessor; template <> struct cache_accessor { using carrier_uint = float_info::carrier_uint; @@ -1127,7 +1127,7 @@ FMT_FUNC uint128_fallback get_cached_power(int k) noexcept { } // Various integer checks -template +template bool is_left_endpoint_integer_shorter_interval(int exponent) noexcept { const int case_shorter_interval_left_endpoint_lower_threshold = 2; const int case_shorter_interval_left_endpoint_upper_threshold = 3; @@ -1142,7 +1142,8 @@ FMT_INLINE int remove_trailing_zeros(uint32_t& n) noexcept { // See https://github.com/fmtlib/fmt/issues/3163 for more details. const uint32_t mod_inv_5 = 0xcccccccd; // Casts are needed to workaround a bug in MSVC 19.22 and older. - const uint32_t mod_inv_25 = static_cast(uint64_t(mod_inv_5) * mod_inv_5); + const uint32_t mod_inv_25 = + static_cast(uint64_t(mod_inv_5) * mod_inv_5); int s = 0; while (true) { @@ -1213,7 +1214,7 @@ FMT_INLINE int remove_trailing_zeros(uint64_t& n) noexcept { } // The main algorithm for shorter interval case -template +template FMT_INLINE decimal_fp shorter_interval_case(int exponent) noexcept { decimal_fp ret_value; // Compute k and beta diff --git a/include/fmt/format.h b/include/fmt/format.h index 2c4a8b7d..6ee29e72 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -485,7 +485,7 @@ inline auto bit_cast(const From& from) -> To { return result; } -template +template FMT_CONSTEXPR20 inline auto countl_zero_fallback(UInt n) -> int { int lz = 0; constexpr UInt msb_mask = static_cast(1) << (num_bits() - 1); diff --git a/include/fmt/ostream.h b/include/fmt/ostream.h index d3bb432c..6a302b42 100644 --- a/include/fmt/ostream.h +++ b/include/fmt/ostream.h @@ -62,7 +62,7 @@ struct is_streamable< namespace { struct file_access_tag {}; } // namespace -template +template class file_access { friend auto get_file(BufType& obj) -> FILE* { return obj.*FileMemberPtr; } }; diff --git a/include/fmt/ranges.h b/include/fmt/ranges.h index 755f49df..711424c8 100644 --- a/include/fmt/ranges.h +++ b/include/fmt/ranges.h @@ -226,7 +226,7 @@ template class is_tuple_formattable_ { decltype(check(tuple_index_sequence{}))::value; }; -template +template void for_each(index_sequence, Tuple&& tup, F&& f) noexcept { using std::get; // Using free function get(T) now. @@ -234,13 +234,13 @@ void for_each(index_sequence, Tuple&& tup, F&& f) noexcept { ignore_unused(unused); } -template +template FMT_CONSTEXPR auto get_indexes(const T&) -> make_index_sequence::value> { return {}; } -template void for_each(Tuple&& tup, F&& f) { +template void for_each(Tuple&& tup, F&& f) { const auto indexes = get_indexes(tup); for_each(indexes, std::forward(tup), std::forward(f)); } @@ -489,7 +489,7 @@ struct range_formatter< return underlying_.parse(ctx); } - template + template auto format(R&& range, FormatContext& ctx) const -> decltype(ctx.out()) { detail::range_mapper> mapper; auto out = ctx.out();