Use C++11 compatible std::is_same operations

The `operator()` member function of `std::is_same` was added in C++14.  For C++11, the `::value` needs to be used instead.
This commit is contained in:
Greg Sjaardema 2020-01-14 10:54:19 -07:00 committed by Victor Zverovich
parent c8dd9cc99d
commit 40638a75b3

View File

@ -1038,7 +1038,7 @@ void fallback_format(Double d, buffer<char>& buf, int& exp10) {
// if T is a IEEE754 binary32 or binary64 and snprintf otherwise.
template <typename T>
int format_float(T value, int precision, float_specs specs, buffer<char>& buf) {
static_assert(!std::is_same<T, float>(), "");
static_assert(!std::is_same<T, float>::value, "");
FMT_ASSERT(value >= 0, "value is negative");
const bool fixed = specs.format == float_format::fixed;
@ -1113,7 +1113,7 @@ int snprintf_float(T value, int precision, float_specs specs,
buffer<char>& buf) {
// Buffer capacity must be non-zero, otherwise MSVC's vsnprintf_s will fail.
FMT_ASSERT(buf.capacity() > buf.size(), "empty buffer");
static_assert(!std::is_same<T, float>(), "");
static_assert(!std::is_same<T, float>::value, "");
// Subtract 1 to account for the difference in precision since we use %e for
// both general and exponent format.