From ef0778d097037bad887b3d3038a436b6f1dc983b Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Tue, 30 Jun 2015 22:12:54 +0200 Subject: 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 Reviewed-by: Thiago Macieira --- src/corelib/io/qtextstream.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/corelib/io/qtextstream.h') 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: -- cgit v1.2.3