q23type_traits.h: use is_scoped_enum_v from std
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 03a7be37806a32e9a8ac963b309812d6b8f125f6 and 63a8f657c2236829f16016602d9c0098b089d35e. Change-Id: I7f9149678b95f7a59643152abf5a627e226cc058 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 40501ffbb441ce48733b3733b7ab781c7db8cca8) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
4354d7797e
commit
fc29f57a17
@ -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>>
|
||||
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user