From b7657ddccbe0a5ab1cdfc61ae6b7f0501dbfb24a Mon Sep 17 00:00:00 2001 From: David Faure Date: Mon, 20 Nov 2023 20:46:23 +0100 Subject: 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 Reviewed-by: Marc Mutz Reviewed-by: Volker Hilsheimer --- src/corelib/io/qdebug.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/corelib/io/qdebug.cpp') 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 @@ -1018,6 +1018,15 @@ QDebug &QDebug::resetFormat() \c T2 need to support streaming into QDebug. */ +/*! + \since 6.7 + \fn template QDebug operator<<(QDebug debug, const std::optional &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 QDebug operator<<(QDebug debug, const QContiguousCache &cache) \relates QDebug @@ -1050,6 +1059,13 @@ QDebug &QDebug::resetFormat() \internal */ +/*! + \since 6.7 + \fn QDebug &QDebug::operator<<(std::nullopt_t) + + Writes nullopt to the stream. +*/ + /*! \class QDebugStateSaver \inmodule QtCore -- cgit v1.2.3