Skip to content

Commit edb77ce

Browse files
lzhangzzgrimoire
authored andcommitted
[Fix] include missing <type_traits> for formatter.h (open-mmlab#313)
* fix formatter * relax GCC version requirement
1 parent 20282d0 commit edb77ce

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

csrc/core/utils/formatter.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
#if FMT_VERSION >= 50000
99
#include "spdlog/fmt/bundled/ranges.h"
10+
#else
11+
#include <type_traits>
1012
#endif
1113

1214
namespace mmdeploy {
@@ -36,7 +38,7 @@ inline void format_arg(BasicFormatter<char> &f, const char *, const mmdeploy::Va
3638
f.writer() << mmdeploy::format_value(d);
3739
}
3840

39-
template <typename T, std::enable_if_t<std::is_enum_v<std::decay_t<T> >, bool> = true>
41+
template <typename T, std::enable_if_t<std::is_enum<std::decay_t<T> >::value, bool> = true>
4042
void format_arg(BasicFormatter<char> &f, const char *, const T &v) {
4143
f.writer() << (int)v;
4244
}

0 commit comments

Comments
 (0)