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>
This commit is contained in:
Marc Mutz 2012-02-28 22:27:48 +01:00 committed by Qt by Nokia
parent ec234625c0
commit 8b33be0054

View File

@ -51,7 +51,7 @@ template <typename T>
class QScopedValueRollback
{
public:
QScopedValueRollback(T &var) :
explicit QScopedValueRollback(T &var) :
varRef(var)
{
oldValue = varRef;