mirror of
https://github.com/fmtlib/fmt.git
synced 2025-07-30 10:47:35 +02:00
Improve sign processing
This commit is contained in:
@ -1120,7 +1120,7 @@ template <typename Char, typename Sign> constexpr auto sign(Sign s) -> Char {
|
|||||||
#if !FMT_GCC_VERSION || FMT_GCC_VERSION >= 604
|
#if !FMT_GCC_VERSION || FMT_GCC_VERSION >= 604
|
||||||
static_assert(std::is_same<Sign, sign_t>::value, "");
|
static_assert(std::is_same<Sign, sign_t>::value, "");
|
||||||
#endif
|
#endif
|
||||||
return static_cast<Char>("\0-+ "[s]);
|
return static_cast<char>(((' ' << 24) | ('+' << 16) | ('-' << 8)) >> (s * 8));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T> FMT_CONSTEXPR auto count_digits_fallback(T n) -> int {
|
template <typename T> FMT_CONSTEXPR auto count_digits_fallback(T n) -> int {
|
||||||
|
Reference in New Issue
Block a user