Use const_check to silence constexpr warning
This commit is contained in:
parent
ee339bcfa3
commit
313c48baff
@ -938,11 +938,7 @@ template <int GRISU_VERSION> struct grisu_shortest_handler {
|
||||
uint64_t error, int exp, bool integral) {
|
||||
buf[size++] = digit;
|
||||
if (remainder >= error) return digits::more;
|
||||
#ifdef __cpp_if_constexpr
|
||||
if constexpr (GRISU_VERSION != 3) {
|
||||
#else
|
||||
if (GRISU_VERSION != 3) {
|
||||
#endif
|
||||
if (const_check(GRISU_VERSION != 3)) {
|
||||
uint64_t d = integral ? diff : diff * data::powers_of_10_64[-exp];
|
||||
round(d, divisor, remainder, error);
|
||||
return digits::done;
|
||||
|
||||
@ -192,6 +192,10 @@ FMT_END_NAMESPACE
|
||||
FMT_BEGIN_NAMESPACE
|
||||
namespace internal {
|
||||
|
||||
// A helper function to suppress bogus "conditional expression is constant"
|
||||
// warnings.
|
||||
template <typename T> inline T const_check(T value) { return value; }
|
||||
|
||||
// A fallback implementation of uintptr_t for systems that lack it.
|
||||
struct fallback_uintptr {
|
||||
unsigned char value[sizeof(void*)];
|
||||
|
||||
@ -16,10 +16,6 @@
|
||||
FMT_BEGIN_NAMESPACE
|
||||
namespace internal {
|
||||
|
||||
// A helper function to suppress bogus "conditional expression is constant"
|
||||
// warnings.
|
||||
template <typename T> inline T const_check(T value) { return value; }
|
||||
|
||||
// Checks if a value fits in int - used to avoid warnings about comparing
|
||||
// signed and unsigned integers.
|
||||
template <bool IsSigned> struct int_checker {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user