Format chrono.h with clang-format
This commit is contained in:
parent
b8e3e3388c
commit
5619e8757c
@ -1393,8 +1393,7 @@ template <class Duration> class subsecond_helper {
|
|||||||
/// Returns the amount of digits according to the c++ 20 spec
|
/// Returns the amount of digits according to the c++ 20 spec
|
||||||
/// In the range [0, 18], if more than 18 fractional digits are required,
|
/// In the range [0, 18], if more than 18 fractional digits are required,
|
||||||
/// then we return 6 for microseconds precision
|
/// then we return 6 for microseconds precision
|
||||||
static constexpr int num_digits(std::intmax_t num,
|
static constexpr int num_digits(std::intmax_t num, std::intmax_t den,
|
||||||
std::intmax_t den,
|
|
||||||
int n = 0) {
|
int n = 0) {
|
||||||
return num % den == 0 ? n : (n > 18 ? 6 : num_digits(num * 10, den, n + 1));
|
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>
|
template <typename RepType> void write(RepType value, int width) {
|
||||||
void write(RepType value, int width) {
|
|
||||||
write_sign();
|
write_sign();
|
||||||
if (isnan(value)) return write_nan();
|
if (isnan(value)) return write_nan();
|
||||||
uint32_or_64_or_128_t<std::intmax_t> n =
|
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,
|
if (std::ratio_less<typename subsec_helper::precision::period,
|
||||||
std::chrono::seconds::period>::value) {
|
std::chrono::seconds::period>::value) {
|
||||||
*out++ = '.';
|
*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;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user