diff options
| author | David Faure <david.faure@kdab.com> | 2023-11-20 20:46:23 +0100 |
|---|---|---|
| committer | David Faure <david.faure@kdab.com> | 2023-11-22 05:56:25 +0100 |
| commit | b7657ddccbe0a5ab1cdfc61ae6b7f0501dbfb24a (patch) | |
| tree | 4909c75ee34a05c5c1559406d13dc4db8e915f79 /src/corelib/io/qdebug.cpp | |
| parent | dc7eb46352374f811841fda87c58c7dc1d52d787 (diff) | |
qDebug: add support for std::optional and std::nullopt_t
[ChangeLog][QtCore][QDebug] Added support for std::optional
and std::nullopt_t
Change-Id: I1e6196adb408401cae8776cd0c60af294a39a83f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/corelib/io/qdebug.cpp')
| -rw-r--r-- | src/corelib/io/qdebug.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/corelib/io/qdebug.cpp b/src/corelib/io/qdebug.cpp index 5c42ee2e1cf..4f6b1696eb9 100644 --- a/src/corelib/io/qdebug.cpp +++ b/src/corelib/io/qdebug.cpp @@ -1019,6 +1019,15 @@ QDebug &QDebug::resetFormat() */ /*! + \since 6.7 + \fn template <class T> QDebug operator<<(QDebug debug, const std::optional<T> &opt) + \relates QDebug + + Writes the contents of \a opt (or \c nullopt if not set) to \a debug. + \c T needs to support streaming into QDebug. +*/ + +/*! \fn template <typename T> QDebug operator<<(QDebug debug, const QContiguousCache<T> &cache) \relates QDebug @@ -1051,6 +1060,13 @@ QDebug &QDebug::resetFormat() */ /*! + \since 6.7 + \fn QDebug &QDebug::operator<<(std::nullopt_t) + + Writes nullopt to the stream. +*/ + +/*! \class QDebugStateSaver \inmodule QtCore \brief Convenience class for custom QDebug operators. |
