diff options
author | Olivier Goffart <ogoffart@trolltech.com> | 2009-04-19 21:12:21 +0200 |
---|---|---|
committer | Olivier Goffart <olivier.goffart@nokia.com> | 2010-09-03 12:57:10 +0200 |
commit | da0e1a682362144b9f13b4c564f86e09efb681bb (patch) | |
tree | 8cbf68a93b055515b2a56d9e0667c530b27e39e2 /src/gui/painting/qpen.h | |
parent | 605aa0cf1889110620dc0d5d84066be8177fe9c2 (diff) |
C++0x move operators
This makes assignement faster from temporaries, as the operator is
fully inline, and doesn't do any atomic operations.
Reviewed-by: joao
Diffstat (limited to 'src/gui/painting/qpen.h')
-rw-r--r-- | src/gui/painting/qpen.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gui/painting/qpen.h b/src/gui/painting/qpen.h index aff70711c0..4006112dd7 100644 --- a/src/gui/painting/qpen.h +++ b/src/gui/painting/qpen.h @@ -74,6 +74,10 @@ public: ~QPen(); QPen &operator=(const QPen &pen); +#ifdef Q_COMPILER_RVALUE_REFS + inline QPen &operator=(QPen &&other) + { qSwap(d, other.d); return *this; } +#endif Qt::PenStyle style() const; void setStyle(Qt::PenStyle); |