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>
This commit is contained in:
parent
0461c535fc
commit
4097653215
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user