summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qtextstream.h
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2015-06-30 22:12:54 +0200
committerMarc Mutz <marc.mutz@kdab.com>2015-07-07 05:22:23 +0000
commitef0778d097037bad887b3d3038a436b6f1dc983b (patch)
tree18811461c16f514086e0047378bba01fc3757545 /src/corelib/io/qtextstream.h
parent48d7a53abf53e2798ce532f5f9c2b38d3806d430 (diff)
Mark QTextStreamManipulator ctors constexpr nothrow
And use Q_NULLPTR and the ctor-init-list. Found while looking into QTBUG-45291. Change-Id: Ie6db7c2ffe4e054781f0666da593df898b8000e0 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/io/qtextstream.h')
-rw-r--r--src/corelib/io/qtextstream.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/io/qtextstream.h b/src/corelib/io/qtextstream.h
index e5f429ae4d..eb33db63d7 100644
--- a/src/corelib/io/qtextstream.h
+++ b/src/corelib/io/qtextstream.h
@@ -205,8 +205,8 @@ typedef void (QTextStream::*QTSMFC)(QChar); // manipulator w/QChar argument
class Q_CORE_EXPORT QTextStreamManipulator
{
public:
- QTextStreamManipulator(QTSMFI m, int a) { mf = m; mc = 0; arg = a; }
- QTextStreamManipulator(QTSMFC m, QChar c) { mf = 0; mc = m; ch = c; arg = -1; }
+ Q_DECL_CONSTEXPR QTextStreamManipulator(QTSMFI m, int a) Q_DECL_NOTHROW : mf(m), mc(Q_NULLPTR), arg(a), ch() {}
+ Q_DECL_CONSTEXPR QTextStreamManipulator(QTSMFC m, QChar c) Q_DECL_NOTHROW : mf(Q_NULLPTR), mc(m), arg(-1), ch(c) {}
void exec(QTextStream &s) { if (mf) { (s.*mf)(arg); } else { (s.*mc)(ch); } }
private: