Skip to content

Commit

Permalink
q23type_traits: fix build with C++23
Browse files Browse the repository at this point in the history
Commit 03a7be3 forgot to use the enum
in the using declaration.

Change-Id: I1ff966c0bf669ff03bc9fffd049d64ebeb156f69
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
  • Loading branch information
thiagomacieira committed Aug 18, 2024
1 parent 7447ad5 commit 63a8f65
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/corelib/global/q23type_traits.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 63a8f65

Please sign in to comment.