mirror of
https://github.com/fmtlib/fmt.git
synced 2024-10-02 04:52:03 +00:00
Improve sign processing
This commit is contained in:
parent
808ea0191a
commit
0f87d6ffa6
@ -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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user