summaryrefslogtreecommitdiffstats
path: root/src/corelib/io
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2020-10-15 09:10:08 +0200
committerLars Knoll <lars.knoll@qt.io>2020-10-16 09:48:09 +0200
commit40976532158fc49be45bb976455f48e98f9690cf (patch)
treee14710c51c2d6c51857f32f6cff08215d5f810c9 /src/corelib/io
parent0461c535fcb26ea231ee8645e67ef2e8d4429e95 (diff)
Fix signature of QDebug::toString()
We don't need two overloads here. Change-Id: Ia6a3bcd93491843e07b0295fefe8da42ae9d6519 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/io')
-rw-r--r--src/corelib/io/qdebug.cpp9
-rw-r--r--src/corelib/io/qdebug.h13
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;
}
};