diff --git a/src/corelib/global/qminmax.h b/src/corelib/global/qminmax.h index e6fb62bf9d..fca13e047e 100644 --- a/src/corelib/global/qminmax.h +++ b/src/corelib/global/qminmax.h @@ -11,31 +11,10 @@ #include #include - -#include +#include QT_BEGIN_NAMESPACE -namespace QTypeTraits { - -namespace detail { -template && std::is_arithmetic_v && - std::is_floating_point_v == std::is_floating_point_v && - std::is_signed_v == std::is_signed_v && - !std::is_same_v && !std::is_same_v && - !std::is_same_v && !std::is_same_v>> -struct Promoted -{ - using type = decltype(T() + U()); -}; -} - -template -using Promoted = typename detail::Promoted::type; - -} - template constexpr inline const T &qMin(const T &a, const T &b) { return (a < b) ? a : b; } template diff --git a/src/corelib/global/qttypetraits.h b/src/corelib/global/qttypetraits.h index 1efb24bf70..35dfad155b 100644 --- a/src/corelib/global/qttypetraits.h +++ b/src/corelib/global/qttypetraits.h @@ -60,6 +60,26 @@ template struct type_dependent_false : std::false_type {}; template struct value_dependent_false : std::false_type {}; } +namespace QTypeTraits { + +namespace detail { +template && std::is_arithmetic_v && + std::is_floating_point_v == std::is_floating_point_v && + std::is_signed_v == std::is_signed_v && + !std::is_same_v && !std::is_same_v && + !std::is_same_v && !std::is_same_v>> +struct Promoted +{ + using type = decltype(T() + U()); +}; +} + +template +using Promoted = typename detail::Promoted::type; + +} // namespace QTypeTraits + QT_END_NAMESPACE #endif // QTTYPETRAITS_H