class -> typename

This commit is contained in:
Victor Zverovich 2023-02-18 10:23:42 -08:00
parent 1741e90dec
commit 507c3042d8
5 changed files with 12 additions and 11 deletions

View File

@ -504,7 +504,7 @@ inline std::tm localtime(std::time_t time) {
}
#if FMT_USE_LOCAL_TIME
template <class Duration>
template <typename Duration>
inline auto localtime(std::chrono::local_time<Duration> time) -> std::tm {
return localtime(std::chrono::system_clock::to_time_t(
std::chrono::current_zone()->to_sys(time)));

View File

@ -257,7 +257,7 @@ inline uint64_t divide_by_10_to_kappa_plus_1(uint64_t n) noexcept {
}
// Various subroutines using pow10 cache
template <class T> struct cache_accessor;
template <typename T> struct cache_accessor;
template <> struct cache_accessor<float> {
using carrier_uint = float_info<float>::carrier_uint;
@ -1127,7 +1127,7 @@ FMT_FUNC uint128_fallback get_cached_power(int k) noexcept {
}
// Various integer checks
template <class T>
template <typename T>
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<uint32_t>(uint64_t(mod_inv_5) * mod_inv_5);
const uint32_t mod_inv_25 =
static_cast<uint32_t>(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 <class T>
template <typename T>
FMT_INLINE decimal_fp<T> shorter_interval_case(int exponent) noexcept {
decimal_fp<T> ret_value;
// Compute k and beta

View File

@ -485,7 +485,7 @@ inline auto bit_cast(const From& from) -> To {
return result;
}
template <class UInt>
template <typename UInt>
FMT_CONSTEXPR20 inline auto countl_zero_fallback(UInt n) -> int {
int lz = 0;
constexpr UInt msb_mask = static_cast<UInt>(1) << (num_bits<UInt>() - 1);

View File

@ -62,7 +62,7 @@ struct is_streamable<
namespace {
struct file_access_tag {};
} // namespace
template <class Tag, class BufType, FILE* BufType::*FileMemberPtr>
template <typename Tag, typename BufType, FILE* BufType::*FileMemberPtr>
class file_access {
friend auto get_file(BufType& obj) -> FILE* { return obj.*FileMemberPtr; }
};

View File

@ -226,7 +226,7 @@ template <typename T, typename C> class is_tuple_formattable_<T, C, true> {
decltype(check(tuple_index_sequence<T>{}))::value;
};
template <class Tuple, class F, size_t... Is>
template <typename Tuple, typename F, size_t... Is>
void for_each(index_sequence<Is...>, Tuple&& tup, F&& f) noexcept {
using std::get;
// Using free function get<I>(T) now.
@ -234,13 +234,13 @@ void for_each(index_sequence<Is...>, Tuple&& tup, F&& f) noexcept {
ignore_unused(unused);
}
template <class T>
template <typename T>
FMT_CONSTEXPR auto get_indexes(const T&)
-> make_index_sequence<std::tuple_size<T>::value> {
return {};
}
template <class Tuple, class F> void for_each(Tuple&& tup, F&& f) {
template <typename Tuple, typename F> void for_each(Tuple&& tup, F&& f) {
const auto indexes = get_indexes(tup);
for_each(indexes, std::forward<Tuple>(tup), std::forward<F>(f));
}
@ -489,7 +489,7 @@ struct range_formatter<
return underlying_.parse(ctx);
}
template <typename R, class FormatContext>
template <typename R, typename FormatContext>
auto format(R&& range, FormatContext& ctx) const -> decltype(ctx.out()) {
detail::range_mapper<buffer_context<Char>> mapper;
auto out = ctx.out();