From 1e11f8fa80e5bbce11d0dfe7213d8af1e8c10fe3 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sat, 16 Mar 2024 18:41:27 -0700 Subject: QDBusArgument: disambiguate between QMap on std::pair and std::map For QMap on a std::pair, QMap::iterator{}.operator->() would result in a type that has "first" and "second" members: std::pair itself. But it would be wrong to marshall and demarshall the first and second elements thereof as the key and value, so give preference to the .key() and .value() selection, which would store the std::pair as the type. Fixes: QTBUG-123401 Pick-to: 6.5 Change-Id: I6818d78a57394e37857bfffd17bd69bb692dd03b Reviewed-by: Alexey Edelev (cherry picked from commit 5401a9a6cd3263eda15911c3fbfc81ebea2e798f) Reviewed-by: Qt Cherry-pick Bot (cherry picked from commit 9ffed81b159e9bdf4aba26dfdbd08ff508ffe8b3) --- src/corelib/tools/qcontainertools_impl.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/corelib/tools/qcontainertools_impl.h b/src/corelib/tools/qcontainertools_impl.h index 40ed0a84e9..280bb585c2 100644 --- a/src/corelib/tools/qcontainertools_impl.h +++ b/src/corelib/tools/qcontainertools_impl.h @@ -300,7 +300,11 @@ using IfAssociativeIteratorHasKeyAndValue = template using IfAssociativeIteratorHasFirstAndSecond = - std::enable_if_t, bool>; + std::enable_if_t< + std::conjunction_v< + std::negation>, + qxp::is_detected + >, bool>; template using MoveBackwardsTest = decltype( -- cgit v1.2.3