Renam flag to FMT_REDUCE_INT_INSTANTIATIONS
Add comment above FMT_REDUCE_INT_INSTANTIATIONS definition describing why a developer would use it.
This commit is contained in:
parent
cb0a609280
commit
e136a9dd88
@ -311,8 +311,12 @@ struct int128_t {};
|
|||||||
struct uint128_t {};
|
struct uint128_t {};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(FMT_USE_SMALLEST_INT)
|
// Defining FMT_REDUCE_INT_INSTANTIATIONS to 1, will reduce the number of
|
||||||
#define FMT_USE_SMALLEST_INT 1
|
// int_writer template instances to just one by only using the largest integer
|
||||||
|
// type. This results in a reduction in binary size but will cause a decrease in
|
||||||
|
// integer formatting performance.
|
||||||
|
#if !defined(FMT_REDUCE_INT_INSTANTIATIONS)
|
||||||
|
# define FMT_REDUCE_INT_INSTANTIATIONS 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Casts a nonnegative integer to unsigned.
|
// Casts a nonnegative integer to unsigned.
|
||||||
|
|||||||
@ -726,18 +726,18 @@ FMT_CONSTEXPR bool is_supported_floating_point(T) {
|
|||||||
(std::is_same<T, long double>::value && FMT_USE_LONG_DOUBLE);
|
(std::is_same<T, long double>::value && FMT_USE_LONG_DOUBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if FMT_USE_SMALLEST_INT
|
#if FMT_REDUCE_INT_INSTANTIATIONS
|
||||||
|
// Pick the largest integer container to represent all values of T.
|
||||||
|
template <typename T>
|
||||||
|
using uint32_or_64_or_128_t =
|
||||||
|
conditional_t<sizeof(uint128_t) < sizeof(uint64_t), uint64_t, uint128_t>;
|
||||||
|
#else
|
||||||
// Smallest of uint32_t, uint64_t, uint128_t that is large enough to
|
// Smallest of uint32_t, uint64_t, uint128_t that is large enough to
|
||||||
// represent all values of T.
|
// represent all values of T.
|
||||||
template <typename T>
|
template <typename T>
|
||||||
using uint32_or_64_or_128_t = conditional_t<
|
using uint32_or_64_or_128_t = conditional_t<
|
||||||
std::numeric_limits<T>::digits <= 32, uint32_t,
|
std::numeric_limits<T>::digits <= 32, uint32_t,
|
||||||
conditional_t<std::numeric_limits<T>::digits <= 64, uint64_t, uint128_t>>;
|
conditional_t<std::numeric_limits<T>::digits <= 64, uint64_t, uint128_t>>;
|
||||||
#else
|
|
||||||
// Pick the largest integer container to represent represent all values of T.
|
|
||||||
template <typename T>
|
|
||||||
using uint32_or_64_or_128_t =
|
|
||||||
conditional_t<sizeof(uint128_t) < sizeof(uint64_t), uint64_t, uint128_t>;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Static data is placed in this class template for the header-only config.
|
// Static data is placed in this class template for the header-only config.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user