* Remove <typename UInt> from int_writer
Reduce code bloat by removing multiple instantiation of int_writer based
on the <typename UInt> parameter.
Rationale:
- The only functions that gains a speedup by int size would be
int_writer::on_dec()'s call to count_digits which uses CLZ. Thus to
still take advantage of this speedup, we store the size of the int
so we can use a switch statement to call the correct count_digits.
- All other implementations of count_digits require some sort of looping
that terminates when the value hits zero regardless of what sized int
it is.
Caveats:
- There is a performance hit when dealing with and passing around
64-bit/128-bit values compared to 32-bit values on 32-bit platforms,
and with 64-bit values on 64-bit systems. But this should not reduce the
performance that dramatically.
- There is also a performance hit for on_dec() due to the addition of a
switch case. But, due to it size, this should reduce to a jump table.
Resolves#1778
* Add FMT_USE_SMALLEST_INT flag
When defined and set to zero, will use the largest available integer
container for writing ints. The has the benefit of reducing instances
the of int_writer class which will reduce the binary cost.
* Rename flag to FMT_REDUCE_INT_INSTANTIATIONS
Add comment above FMT_REDUCE_INT_INSTANTIATIONS definition describing
why a developer would use it.
* Move FMT_REDUCE_INT_INSTANTIATIONS to format.h
Co-authored-by: Khalil Estell <kammce@google.com>
Use the version range feature introduced in 3.12. On CMake <3.12 the extra dots are simply interpreted as extra version number separators.
The fallback for ancient CMake versions is kept.
* Trying to clear ambiguous compile time claims
Documentation was a bit misleading.
Many people assume that fmt does compile time checks by default, while it requires the use of `FMT_STRING`.
It was also unclear that FMT_COMPILE does the same checks.
https://github.com/fmtlib/fmt/issues/1772
* Update api.rst