From 1596b5855cd3cf1147fc364ab10969f0c01cfe32 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 11 Dec 2024 17:08:30 -0300 Subject: [PATCH] QDebug: constrain the new Standard Library op<< So they be SFINAE-ruled out when either the key or (for associative containers) value types don't provide their debug-streaming operators either. Amends 850d4895be565931d18c92e5e2f9a33b7f26de6d, 0c96528e8d43ad4309bdca14b179a5045984655a, a9fe57fefaac0cb047e4c02e0b8c8f8327e0a58c. Fixes: QTBUG-132104 Task-number: QTBUG-130290 Change-Id: I1d6703b1fdf6cfd03799fffd33191d8028ecc123 Reviewed-by: Ivan Solovev (cherry picked from commit 8f958a6e2dcff5bb9b01442a19f5605f357c6e7e) --- src/corelib/io/qdebug.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/corelib/io/qdebug.h b/src/corelib/io/qdebug.h index 737da819705..d21f4072acb 100644 --- a/src/corelib/io/qdebug.h +++ b/src/corelib/io/qdebug.h @@ -450,25 +450,25 @@ inline QDebugIfHasDebugStream operator<<(QDebug debug, const std::multim } template -inline QDebug operator<<(QDebug debug, const std::multiset &multiset) +inline QDebugIfHasDebugStream operator<<(QDebug debug, const std::multiset &multiset) { return QtPrivate::printSequentialContainer(std::move(debug), "std::multiset", multiset); } template -inline QDebug operator<<(QDebug debug, const std::set& set) +inline QDebugIfHasDebugStream operator<<(QDebug debug, const std::set &set) { return QtPrivate::printSequentialContainer(std::move(debug), "std::set", set); } template -inline QDebug operator<<(QDebug debug, const std::unordered_map &unordered_map) +inline QDebugIfHasDebugStream operator<<(QDebug debug, const std::unordered_map &unordered_map) { return QtPrivate::printSequentialContainer(std::move(debug), "std::unordered_map", unordered_map); // yes, sequential: *it is std::pair } template -inline QDebug operator<<(QDebug debug, const std::unordered_set& unordered_set) +inline QDebugIfHasDebugStream operator<<(QDebug debug, const std::unordered_set &unordered_set) { return QtPrivate::printSequentialContainer(std::move(debug), "std::unordered_set", unordered_set); }