diff options
author | Kai Koehne <kai.koehne@digia.com> | 2014-06-20 12:30:58 +0200 |
---|---|---|
committer | hjk <hjk121@nokiamail.com> | 2014-06-25 17:45:54 +0200 |
commit | ef077750ce47212570c9bc1ce6367309678440f6 (patch) | |
tree | 6d29956fe125f8bcd97d6ed4ec57f59ba73f6422 /src/corelib | |
parent | b7f8e7664a38e401c6af6f2447cd565422109f7a (diff) |
QDebug: Remove handling of FORCE_UREF define
This is the only place in Qt source code we use FORCE_UREF, and can
be traced back to the very first qt.git commit. In any case, it's
broken: It returns a reference to a local variable, since the debug
argument is _not_ a reference.
Using a reference both for the argument and the return value would
be actually the canonical solution, but that breaks with
QDebug << operator(QDebug, const QVariant &),
exported in QtCore. The C++ lookup rules apparently prefer this
overload then to be used for outputting containers ...
Change-Id: Iaf5e5dd89d4f3ebe6454eba219046b4f25b0d717
Reviewed-by: hjk <hjk121@nokiamail.com>
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/io/qdebug.h | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/src/corelib/io/qdebug.h b/src/corelib/io/qdebug.h index 94b19f9cab..584d6bf41f 100644 --- a/src/corelib/io/qdebug.h +++ b/src/corelib/io/qdebug.h @@ -151,13 +151,8 @@ inline QDebug &QDebug::operator=(const QDebug &other) return *this; } -#if defined(FORCE_UREF) -template <class T> -inline QDebug &operator<<(QDebug debug, const QList<T> &list) -#else template <class T> inline QDebug operator<<(QDebug debug, const QList<T> &list) -#endif { const bool oldSetting = debug.autoInsertSpaces(); debug.nospace() << '('; @@ -171,13 +166,8 @@ inline QDebug operator<<(QDebug debug, const QList<T> &list) return debug.maybeSpace(); } -#if defined(FORCE_UREF) -template <typename T> -inline QDebug &operator<<(QDebug debug, const QVector<T> &vec) -#else template <typename T> inline QDebug operator<<(QDebug debug, const QVector<T> &vec) -#endif { const bool oldSetting = debug.autoInsertSpaces(); debug.nospace() << "QVector"; @@ -185,13 +175,8 @@ inline QDebug operator<<(QDebug debug, const QVector<T> &vec) return operator<<(debug, vec.toList()); } -#if defined(FORCE_UREF) -template <class aKey, class aT> -inline QDebug &operator<<(QDebug debug, const QMap<aKey, aT> &map) -#else template <class aKey, class aT> inline QDebug operator<<(QDebug debug, const QMap<aKey, aT> &map) -#endif { const bool oldSetting = debug.autoInsertSpaces(); debug.nospace() << "QMap("; @@ -204,13 +189,8 @@ inline QDebug operator<<(QDebug debug, const QMap<aKey, aT> &map) return debug.maybeSpace(); } -#if defined(FORCE_UREF) -template <class aKey, class aT> -inline QDebug &operator<<(QDebug debug, const QHash<aKey, aT> &hash) -#else template <class aKey, class aT> inline QDebug operator<<(QDebug debug, const QHash<aKey, aT> &hash) -#endif { const bool oldSetting = debug.autoInsertSpaces(); debug.nospace() << "QHash("; @@ -222,13 +202,8 @@ inline QDebug operator<<(QDebug debug, const QHash<aKey, aT> &hash) return debug.maybeSpace(); } -#if defined(FORCE_UREF) -template <class T1, class T2> -inline QDebug &operator<<(QDebug debug, const QPair<T1, T2> &pair) -#else template <class T1, class T2> inline QDebug operator<<(QDebug debug, const QPair<T1, T2> &pair) -#endif { const bool oldSetting = debug.autoInsertSpaces(); debug.nospace() << "QPair(" << pair.first << ',' << pair.second << ')'; @@ -245,13 +220,8 @@ inline QDebug operator<<(QDebug debug, const QSet<T> &set) return operator<<(debug, set.toList()); } -#if defined(FORCE_UREF) -template <class T> -inline QDebug &operator<<(QDebug debug, const QContiguousCache<T> &cache) -#else template <class T> inline QDebug operator<<(QDebug debug, const QContiguousCache<T> &cache) -#endif { const bool oldSetting = debug.autoInsertSpaces(); debug.nospace() << "QContiguousCache("; @@ -265,13 +235,8 @@ inline QDebug operator<<(QDebug debug, const QContiguousCache<T> &cache) return debug.maybeSpace(); } -#if defined(FORCE_UREF) -template <class T> -inline QDebug &operator<<(QDebug debug, const QFlags<T> &flags) -#else template <class T> inline QDebug operator<<(QDebug debug, const QFlags<T> &flags) -#endif { const bool oldSetting = debug.autoInsertSpaces(); debug.nospace() << "QFlags("; |