Skip to content

Commit

Permalink
Use C++11 compatible std::is_same operations
Browse files Browse the repository at this point in the history
The `operator()` member function of `std::is_same` was added in C++14.  For C++11, the `::value` needs to be used instead.
  • Loading branch information
gsjaardema authored and vitaut committed Jan 15, 2020
1 parent c8dd9cc commit 40638a7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/fmt/format-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 40638a7

Please sign in to comment.