From 2c41d6f7a15f53804c60f388db6caff9fccf90e6 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Fri, 26 Jun 2015 15:17:50 +0200 Subject: QPolygon(F): add some move ctors Change-Id: Ib0eb071e371a7198db26d4279bb901e49b3da2fe Reviewed-by: Friedemann Kleint Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/gui/painting/qpolygon.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/gui/painting/qpolygon.h') diff --git a/src/gui/painting/qpolygon.h b/src/gui/painting/qpolygon.h index 3890715f32..1e503c03b7 100644 --- a/src/gui/painting/qpolygon.h +++ b/src/gui/painting/qpolygon.h @@ -52,11 +52,15 @@ public: inline QPolygon() {} inline ~QPolygon() {} inline explicit QPolygon(int size); - inline QPolygon(const QPolygon &a) : QVector(a) {} inline /*implicit*/ QPolygon(const QVector &v) : QVector(v) {} +#ifdef Q_COMPILER_RVALUE_REFS + /*implicit*/ QPolygon(QVector &&v) Q_DECL_NOTHROW : QVector(std::move(v)) {} +#endif QPolygon(const QRect &r, bool closed=false); QPolygon(int nPoints, const int *points); + QPolygon(const QPolygon &other) : QVector(other) {} #ifdef Q_COMPILER_RVALUE_REFS + QPolygon(QPolygon &&other) Q_DECL_NOTHROW : QVector(std::move(other)) {} QPolygon &operator=(QPolygon &&other) Q_DECL_NOTHROW { swap(other); return *this; } #endif QPolygon &operator=(const QPolygon &other) { QVector::operator=(other); return *this; } @@ -130,11 +134,15 @@ public: inline QPolygonF() {} inline ~QPolygonF() {} inline explicit QPolygonF(int size); - inline QPolygonF(const QPolygonF &a) : QVector(a) {} inline /*implicit*/ QPolygonF(const QVector &v) : QVector(v) {} +#ifdef Q_COMPILER_RVALUE_REFS + /* implicit */ QPolygonF(QVector &&v) Q_DECL_NOTHROW : QVector(std::move(v)) {} +#endif QPolygonF(const QRectF &r); /*implicit*/ QPolygonF(const QPolygon &a); + inline QPolygonF(const QPolygonF &a) : QVector(a) {} #ifdef Q_COMPILER_RVALUE_REFS + QPolygonF(QPolygonF &&other) Q_DECL_NOTHROW : QVector(std::move(other)) {} QPolygonF &operator=(QPolygonF &&other) Q_DECL_NOTHROW { swap(other); return *this; } #endif QPolygonF &operator=(const QPolygonF &other) { QVector::operator=(other); return *this; } -- cgit v1.2.3