Format chrono.h with clang-format

This commit is contained in:
matrackif 2021-12-04 17:50:13 +01:00
parent b8e3e3388c
commit 5619e8757c

View File

@ -1393,8 +1393,7 @@ template <class Duration> class subsecond_helper {
/// Returns the amount of digits according to the c++ 20 spec
/// In the range [0, 18], if more than 18 fractional digits are required,
/// then we return 6 for microseconds precision
static constexpr int num_digits(std::intmax_t num,
std::intmax_t den,
static constexpr int num_digits(std::intmax_t num, std::intmax_t den,
int n = 0) {
return num % den == 0 ? n : (n > 18 ? 6 : num_digits(num * 10, den, n + 1));
}
@ -1589,8 +1588,7 @@ struct chrono_formatter {
}
}
template <typename RepType>
void write(RepType value, int width) {
template <typename RepType> void write(RepType value, int width) {
write_sign();
if (isnan(value)) return write_nan();
uint32_or_64_or_128_t<std::intmax_t> n =
@ -1683,7 +1681,8 @@ struct chrono_formatter {
if (std::ratio_less<typename subsec_helper::precision::period,
std::chrono::seconds::period>::value) {
*out++ = '.';
write(subsec_helper::get_subseconds(duration_rep{val}), subsec_helper::fractional_width);
write(subsec_helper::get_subseconds(duration_rep{val}),
subsec_helper::fractional_width);
}
return;
}