summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2010-01-26 08:54:09 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2010-01-26 08:56:56 (GMT)
commit0c822ea63a8b2b0c32c68a49de81e0c02548f059 (patch)
treedefe0cfe6d334a63cf142062d7aab522596a92d9
parent2109c57ef1fe2d8bbea2ed53c0f76c036843352d (diff)
downloadQt-0c822ea63a8b2b0c32c68a49de81e0c02548f059.zip
Qt-0c822ea63a8b2b0c32c68a49de81e0c02548f059.tar.gz
Qt-0c822ea63a8b2b0c32c68a49de81e0c02548f059.tar.bz2
Don't use QDebug references. Instead, pass by value.
If you use refs, then you can't use this operator as the first argument, since qDebug() returns QDebug by-value (an rvalue temporary). That cannot be bound to a non-const ref. Task-number: QTBUG-7593
-rw-r--r--examples/tools/customtype/message.cpp2
-rw-r--r--examples/tools/customtype/message.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/examples/tools/customtype/message.cpp b/examples/tools/customtype/message.cpp
index 4ef041a..d27159e 100644
--- a/examples/tools/customtype/message.cpp
+++ b/examples/tools/customtype/message.cpp
@@ -64,7 +64,7 @@ Message::Message(const QString &body, const QStringList &headers)
}
//! [custom type streaming operator]
-QDebug &operator<<(QDebug &dbg, const Message &message)
+QDebug operator<<(QDebug dbg, const Message &message)
{
QStringList pieces = message.body().split("\r\n", QString::SkipEmptyParts);
if (pieces.isEmpty())
diff --git a/examples/tools/customtype/message.h b/examples/tools/customtype/message.h
index 361f803..4ef48d4 100644
--- a/examples/tools/customtype/message.h
+++ b/examples/tools/customtype/message.h
@@ -70,7 +70,7 @@ Q_DECLARE_METATYPE(Message);
//! [custom type meta-type declaration]
//! [custom type streaming operator]
-QDebug &operator<<(QDebug &dbg, const Message &message);
+QDebug operator<<(QDebug dbg, const Message &message);
//! [custom type streaming operator]
#endif