summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qdebug.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/io/qdebug.cpp')
-rw-r--r--src/corelib/io/qdebug.cpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/corelib/io/qdebug.cpp b/src/corelib/io/qdebug.cpp
index 598355e4296..39eccd889cf 100644
--- a/src/corelib/io/qdebug.cpp
+++ b/src/corelib/io/qdebug.cpp
@@ -1087,6 +1087,33 @@ QByteArray QDebug::toBytesImpl(StreamTypeErased s, const void *obj)
}
/*!
+ \internal
+ \since 6.9
+
+ Outputs a heterogeneous product type (pair, tuple, or anything that
+ implements the Tuple Protocol). The class name is described by "\a ns
+ \c{::} \a what", while the addresses of the \a n elements are stored in the
+ array \a data. The formatters are stored in the array \a ops.
+
+ If \a ns is empty, only \a what is used.
+*/
+QDebug &QDebug::putTupleLikeImplImpl(const char *ns, const char *what,
+ size_t n, StreamTypeErased *ops, const void **data)
+{
+ const QDebugStateSaver saver(*this);
+ nospace();
+ if (ns && *ns)
+ *this << ns << "::";
+ *this << what << '(';
+ while (n--) {
+ (*ops++)(*this, *data++);
+ if (n)
+ *this << ", ";
+ }
+ return *this << ')';
+}
+
+/*!
\fn template <class T> QDebug operator<<(QDebug debug, const QList<T> &list)
\relates QDebug
@@ -1180,6 +1207,14 @@ QByteArray QDebug::toBytesImpl(StreamTypeErased s, const void *obj)
*/
/*!
+ \fn template <class...Ts, QDebug::if_streamable<Ts...>> QDebug &QDebug::operator<<(const std::tuple<Ts...> &tuple)
+ \since 6.9
+
+ Writes the contents of \a tuple to the stream. All \c Ts... need to support
+ streaming into QDebug.
+*/
+
+/*!
\fn template <class T1, class T2> QDebug operator<<(QDebug debug, const std::pair<T1, T2> &pair)
\relates QDebug