diff options
| author | Dheerendra Purohit <dheerendra@pthinks.com> | 2024-10-25 21:38:54 +0530 |
|---|---|---|
| committer | Dheerendra Purohit <dheerendra@pthinks.com> | 2024-11-20 22:42:38 +0000 |
| commit | a8c9a5617c72ad2e55bf497df6ff2c2e141cbdef (patch) | |
| tree | c1ab31f7e107dbfceb3aa3cfb540e3ea8a734131 /src/corelib/io/qdebug.h | |
| parent | 7be9b5997d84910eeacead251ccdf002f1754147 (diff) | |
QDebug: add streaming operators for std::unordered_set
The stream insertion operator for QDebug is not overloaded
to handle std::unordered_set
Overload the stream insertion operator for QDebug
to handle std::unordered_set
[ChangeLog][QtCOre][QDebug] Added support for std::unordered_set.
Fixes: QTBUG-130481
Change-Id: I75a1f62f9ecb6b06ba45cc00d789cd3f3886b4c7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/io/qdebug.h')
| -rw-r--r-- | src/corelib/io/qdebug.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/corelib/io/qdebug.h b/src/corelib/io/qdebug.h index 3fc63552953..93f326a7307 100644 --- a/src/corelib/io/qdebug.h +++ b/src/corelib/io/qdebug.h @@ -31,6 +31,7 @@ #include <QtCore/q20type_traits.h> #include <utility> #include <unordered_map> +#include <unordered_set> #include <vector> #if !defined(QT_LEAN_HEADERS) || QT_LEAN_HEADERS < 1 @@ -443,6 +444,12 @@ inline QDebug operator<<(QDebug debug, const std::unordered_map<Key, T, Hash, Ke return QtPrivate::printSequentialContainer(std::move(debug), "std::unordered_map", unordered_map); // yes, sequential: *it is std::pair } +template <typename Key, typename Hash, typename KeyEqual, typename Alloc> +inline QDebug operator<<(QDebug debug, const std::unordered_set<Key, Hash, KeyEqual, Alloc>& unordered_set) +{ + return QtPrivate::printSequentialContainer(std::move(debug), "std::unordered_set", unordered_set); +} + template <class Key, class T> inline QDebugIfHasDebugStreamContainer<QMap<Key, T>, Key, T> operator<<(QDebug debug, const QMap<Key, T> &map) { |
