Skip to content

Commit 40638a7

Browse files
gsjaardemavitaut
authored andcommitted
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.
1 parent c8dd9cc commit 40638a7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/fmt/format-inl.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -1038,7 +1038,7 @@ void fallback_format(Double d, buffer<char>& buf, int& exp10) {
10381038
// if T is a IEEE754 binary32 or binary64 and snprintf otherwise.
10391039
template <typename T>
10401040
int format_float(T value, int precision, float_specs specs, buffer<char>& buf) {
1041-
static_assert(!std::is_same<T, float>(), "");
1041+
static_assert(!std::is_same<T, float>::value, "");
10421042
FMT_ASSERT(value >= 0, "value is negative");
10431043

10441044
const bool fixed = specs.format == float_format::fixed;
@@ -1113,7 +1113,7 @@ int snprintf_float(T value, int precision, float_specs specs,
11131113
buffer<char>& buf) {
11141114
// Buffer capacity must be non-zero, otherwise MSVC's vsnprintf_s will fail.
11151115
FMT_ASSERT(buf.capacity() > buf.size(), "empty buffer");
1116-
static_assert(!std::is_same<T, float>(), "");
1116+
static_assert(!std::is_same<T, float>::value, "");
11171117

11181118
// Subtract 1 to account for the difference in precision since we use %e for
11191119
// both general and exponent format.

0 commit comments

Comments
 (0)