@@ -911,13 +911,6 @@ using uint64_or_128_t = conditional_t<num_bits<T>() <= 64, uint64_t, uint128_t>;
911
911
912
912
// Static data is placed in this class template for the header-only config.
913
913
template <typename T = void > struct basic_data {
914
- static constexpr const uint32_t zero_or_powers_of_10_32[] = {
915
- 0 , 0 , FMT_POWERS_OF_10 (1U )};
916
-
917
- static constexpr const uint64_t zero_or_powers_of_10_64[] = {
918
- 0 , 0 , FMT_POWERS_OF_10 (1U ), FMT_POWERS_OF_10 (1000000000ULL ),
919
- 10000000000000000000ULL };
920
-
921
914
// log10(2) = 0x0.4d104d427de7fbcc...
922
915
static const uint64_t log10_2_significand = 0x4d104d427de7fbcc ;
923
916
@@ -993,7 +986,10 @@ FMT_CONSTEXPR20 inline int count_digits(uint64_t n) {
993
986
#ifdef FMT_BUILTIN_CLZLL
994
987
// https://github.com/fmtlib/format-benchmark/blob/master/digits10
995
988
auto t = bsr2log10 (FMT_BUILTIN_CLZLL (n | 1 ) ^ 63 );
996
- return t - (n < data::zero_or_powers_of_10_64[t]);
989
+ constexpr const uint64_t zero_or_powers_of_10[] = {
990
+ 0 , 0 , FMT_POWERS_OF_10 (1U ), FMT_POWERS_OF_10 (1000000000ULL ),
991
+ 10000000000000000000ULL };
992
+ return t - (n < zero_or_powers_of_10[t]);
997
993
#else
998
994
return count_digits_fallback (n);
999
995
#endif
@@ -1029,7 +1025,9 @@ FMT_CONSTEXPR20 inline int count_digits(uint32_t n) {
1029
1025
return count_digits_fallback (n);
1030
1026
}
1031
1027
auto t = bsr2log10 (FMT_BUILTIN_CLZ (n | 1 ) ^ 31 );
1032
- return t - (n < data::zero_or_powers_of_10_32[t]);
1028
+ constexpr const uint32_t zero_or_powers_of_10[] = {0 , 0 ,
1029
+ FMT_POWERS_OF_10 (1U )};
1030
+ return t - (n < zero_or_powers_of_10[t]);
1033
1031
}
1034
1032
#endif
1035
1033
0 commit comments