diff options
author | Marc Mutz <marc.mutz@qt.io> | 2022-06-23 18:31:01 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2022-07-06 17:56:58 +0200 |
commit | c84897c137711cb0a402426758ea1e9af9ff1796 (patch) | |
tree | 63267857ed60eeb71521aea795c1d4675220ba6d /src/corelib/io | |
parent | 0587d4752d8fb814d47a599130d98724d78b1525 (diff) |
QDebug: add op<< for std::initializer_list
We need it in QtHttpServer.
[ChangeLog][QtCore][QDebug] Can now stream std::initializer_list.
Change-Id: I3e940215fb4f4778bd782ea9b30960754ac23d47
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
Diffstat (limited to 'src/corelib/io')
-rw-r--r-- | src/corelib/io/qdebug.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/corelib/io/qdebug.h b/src/corelib/io/qdebug.h index b1f425e616..22328e7c85 100644 --- a/src/corelib/io/qdebug.h +++ b/src/corelib/io/qdebug.h @@ -243,6 +243,12 @@ inline QDebugIfHasDebugStream<T> operator<<(QDebug debug, const std::list<T, All return QtPrivate::printSequentialContainer(debug, "std::list", vec); } +template <typename T> +inline QDebugIfHasDebugStream<T> operator<<(QDebug debug, std::initializer_list<T> list) +{ + return QtPrivate::printSequentialContainer(debug, "std::initializer_list", list); +} + template <typename Key, typename T, typename Compare, typename Alloc> inline QDebugIfHasDebugStream<Key, T> operator<<(QDebug debug, const std::map<Key, T, Compare, Alloc> &map) { |