tst_qmetatype: Fix operator< detection for std::optional
Amends ca54b741d6edda24773137aacee229db31dd3585. operator< is not constrained in MSVC's standard library, either. Fixes: QTBUG-96690 Change-Id: Ibcbb9e53a1f9e8b13786f6d8c01489c61d8d2d7f Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 01d94760d8d34e51e1442682fc151747943c7e25) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
3e98ad97b5
commit
f92df090f5
@ -311,6 +311,8 @@ using expand_operator_less_than_recursive = std::conjunction<expand_operator_les
|
||||
|
||||
template<typename T>
|
||||
struct expand_operator_less_than_tuple : has_operator_less_than<T> {};
|
||||
template<typename T>
|
||||
struct expand_operator_less_than_tuple<std::optional<T>> : has_operator_less_than<T> {};
|
||||
template<typename T1, typename T2>
|
||||
struct expand_operator_less_than_tuple<std::pair<T1, T2>> : expand_operator_less_than_recursive<T1, T2> {};
|
||||
template<typename ...T>
|
||||
|
@ -130,7 +130,9 @@ static_assert(!QTypeTraits::has_operator_less_than_v<std::map<int, NoOperators>>
|
||||
|
||||
// std::optional
|
||||
static_assert(QTypeTraits::has_operator_equal_v<std::optional<QString>>);
|
||||
static_assert(QTypeTraits::has_operator_less_than_v<std::optional<QString>>);
|
||||
static_assert(!QTypeTraits::has_operator_equal_v<std::optional<NoOperators>>);
|
||||
static_assert(!QTypeTraits::has_operator_less_than_v<std::optional<NoOperators>>);
|
||||
|
||||
// nested types
|
||||
static_assert(QTypeTraits::has_operator_equal_v<Nested>);
|
||||
|
Loading…
x
Reference in New Issue
Block a user