q23type_traits: fix build with C++23
Commit 03a7be37806a32e9a8ac963b309812d6b8f125f6 forgot to use the enum in the using declaration. Change-Id: I1ff966c0bf669ff03bc9fffd049d64ebeb156f69 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
This commit is contained in:
parent
7447ad5033
commit
63a8f657c2
@ -26,25 +26,20 @@ QT_BEGIN_NAMESPACE
|
||||
namespace q23 {
|
||||
// like std::is_scoped_enum
|
||||
#ifdef __cpp_lib_is_scoped_enum
|
||||
template<typename E>
|
||||
using is_scoped_enum = std::is_scoped_enum;
|
||||
|
||||
template <typename E>
|
||||
inline constexpr bool is_scoped_enum_v = std::is_scoped_enum_v<E>;
|
||||
using std::is_scoped_enum;
|
||||
#else
|
||||
|
||||
template <typename E, bool isEnum = std::is_enum_v<E>>
|
||||
struct is_scoped_enum : std::negation<std::is_convertible<E, std::underlying_type_t<E>>>
|
||||
{};
|
||||
|
||||
|
||||
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