fmt: do not define uint type in global namespace

This commit is contained in:
Shawn Hoffman 2022-05-10 21:17:10 -07:00 committed by Pokechu22
parent f1625751c4
commit b051903c3d

View File

@ -1354,8 +1354,8 @@ template <typename Float> constexpr int num_significand_bits() {
template <typename Float>
constexpr auto exponent_mask() ->
typename dragonbox::float_info<Float>::carrier_uint {
using uint = typename dragonbox::float_info<Float>::carrier_uint;
return ((uint(1) << dragonbox::float_info<Float>::exponent_bits) - 1)
using fmt_uint = typename dragonbox::float_info<Float>::carrier_uint;
return ((fmt_uint(1) << dragonbox::float_info<Float>::exponent_bits) - 1)
<< num_significand_bits<Float>();
}
template <typename Float> constexpr auto exponent_bias() -> int {
@ -3248,9 +3248,9 @@ FMT_CONSTEXPR20 auto write(OutputIt out, T value) -> OutputIt {
constexpr auto specs = basic_format_specs<Char>();
using floaty = conditional_t<std::is_same<T, long double>::value, double, T>;
using uint = typename dragonbox::float_info<floaty>::carrier_uint;
uint mask = exponent_mask<floaty>();
if ((bit_cast<uint>(value) & mask) == mask)
using fmt_uint = typename dragonbox::float_info<floaty>::carrier_uint;
fmt_uint mask = exponent_mask<floaty>();
if ((bit_cast<fmt_uint>(value) & mask) == mask)
return write_nonfinite(out, std::isnan(value), specs, fspecs);
auto dec = dragonbox::to_decimal(static_cast<floaty>(value));