diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2012-02-28 22:27:48 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-02-29 13:52:01 +0100 |
commit | 8b33be0054517e7506f1ed4378232fa81e710df1 (patch) | |
tree | f9b5c6a6922be8e25a99d63f0cf36a58d3d2e623 /src/corelib/tools/qscopedvaluerollback.h | |
parent | ec234625c0bde3eeb67cd4681cb66277bdf115b3 (diff) | |
download | qtbase-8b33be0054517e7506f1ed4378232fa81e710df1.tar.gz |
QScopedValueRollback: make constructor explicit
I'm not even sure whether you could implicitly
convert a T& into a QScopedValueRollback<T>,
seeing as the constructor takes a non-const
reference, but it looks wrong without explicit
and
QObject o = new QObject(parent);
also won't compile even with implicit QObject(QObject*)
under a conformant compiler because of the disabled
copy constructor, and we still make QObject(QObject*)
explicit, so add it here, too.
Change-Id: I722a6e8431644e450fe2b401ccfb707a8e982380
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
Diffstat (limited to 'src/corelib/tools/qscopedvaluerollback.h')
-rw-r--r-- | src/corelib/tools/qscopedvaluerollback.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/tools/qscopedvaluerollback.h b/src/corelib/tools/qscopedvaluerollback.h index 23d2d9eda0..d53cabd315 100644 --- a/src/corelib/tools/qscopedvaluerollback.h +++ b/src/corelib/tools/qscopedvaluerollback.h @@ -51,7 +51,7 @@ template <typename T> class QScopedValueRollback { public: - QScopedValueRollback(T &var) : + explicit QScopedValueRollback(T &var) : varRef(var) { oldValue = varRef; |