diff options
-rw-r--r-- | src/corelib/io/qdebug.cpp | 9 | ||||
-rw-r--r-- | src/corelib/io/qdebug.h | 13 |
2 files changed, 3 insertions, 19 deletions
diff --git a/src/corelib/io/qdebug.cpp b/src/corelib/io/qdebug.cpp index c711c28f62..1a0ec17397 100644 --- a/src/corelib/io/qdebug.cpp +++ b/src/corelib/io/qdebug.cpp @@ -714,14 +714,7 @@ QDebug &QDebug::resetFormat() */ /*! - \fn template <class T> QString QDebug::toString(const T &object) - \since 6.0 - - \include qdebug-toString.qdocinc -*/ - -/*! - \fn template <class T> QString QDebug::toString(const T *object) + \fn template <class T> QString QDebug::toString(T &&object) \since 6.0 \include qdebug-toString.qdocinc diff --git a/src/corelib/io/qdebug.h b/src/corelib/io/qdebug.h index 3498351639..b737d3e41a 100644 --- a/src/corelib/io/qdebug.h +++ b/src/corelib/io/qdebug.h @@ -157,20 +157,11 @@ public: { stream->ts << m; return *this; } template <typename T> - static QString toString(const T &object) + static QString toString(T &&object) { QString buffer; QDebug stream(&buffer); - stream.nospace() << object; - return buffer; - } - - template <typename T> - static QString toString(const T *object) - { - QString buffer; - QDebug stream(&buffer); - stream.nospace() << object; + stream.nospace() << std::forward<T>(object); return buffer; } }; |