Skip to content

Commit

Permalink
q23type_traits.h: use is_scoped_enum_v from std
Browse files Browse the repository at this point in the history
We don't like surprises in qNN, so use the real is_scoped_enum_v from
std instead of adding the _v version outselves, even in C++20.

Amends 03a7be3 and
63a8f65.

Pick-to: 6.9
Change-Id: I7f9149678b95f7a59643152abf5a627e226cc058
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
  • Loading branch information
marcmutz committed Dec 22, 2024
1 parent a53e095 commit 40501ff
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/corelib/global/q23type_traits.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ namespace q23 {
// like std::is_scoped_enum
#ifdef __cpp_lib_is_scoped_enum
using std::is_scoped_enum;
using std::is_scoped_enum_v;
#else

template <typename E, bool isEnum = std::is_enum_v<E>>
Expand All @@ -36,10 +37,10 @@ struct is_scoped_enum : std::negation<std::is_convertible<E, std::underlying_ty
template<typename T>
struct is_scoped_enum<T, false> : std::false_type
{};
#endif // __cpp_lib_is_scoped_enum

template <typename E>
inline constexpr bool is_scoped_enum_v = is_scoped_enum<E>::value;
#endif // __cpp_lib_is_scoped_enum
}

QT_END_NAMESPACE
Expand Down

0 comments on commit 40501ff

Please sign in to comment.