summaryrefslogtreecommitdiff
path: root/include/ftl/enum.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/ftl/enum.h')
-rw-r--r--include/ftl/enum.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/ftl/enum.h b/include/ftl/enum.h
index 82af1d6cf8..075d12bd17 100644
--- a/include/ftl/enum.h
+++ b/include/ftl/enum.h
@@ -92,7 +92,7 @@ inline constexpr bool is_scoped_enum_v = is_scoped_enum<T>::value;
// enum class E { A, B, C };
// static_assert(ftl::to_underlying(E::B) == 1);
//
-template <typename E>
+template <typename E, typename = std::enable_if_t<std::is_enum_v<E>>>
constexpr auto to_underlying(E v) {
return static_cast<std::underlying_type_t<E>>(v);
}