From 547c8a24da55bfd25eb67a17cb52f31146912062 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 24 Jan 2013 20:35:45 +0100 Subject: [PATCH] Trade: defaulted move constructor/assignment. Hope they will work as expected. Copying is still forbidden, as it brings serious performance impact for no useful reason. --- src/Trade/MeshData2D.h | 8 ++++++-- src/Trade/MeshData3D.h | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/Trade/MeshData2D.h b/src/Trade/MeshData2D.h index 1ad8f30d3..b3457956d 100644 --- a/src/Trade/MeshData2D.h +++ b/src/Trade/MeshData2D.h @@ -35,9 +35,7 @@ type. */ class MAGNUM_EXPORT MeshData2D { MeshData2D(const MeshData2D& other) = delete; - MeshData2D(MeshData2D&& other) = delete; MeshData2D& operator=(const MeshData2D& other) = delete; - MeshData2D& operator=(MeshData2D&& other) = delete; public: /** @@ -52,9 +50,15 @@ class MAGNUM_EXPORT MeshData2D { */ inline MeshData2D(Mesh::Primitive primitive, std::vector* indices, std::vector*> positions, std::vector*> textureCoords2D): _primitive(primitive), _indices(indices), _positions(positions), _textureCoords2D(textureCoords2D) {} + /** @brief Move constructor */ + MeshData2D(MeshData2D&&) = default; + /** @brief Destructor */ ~MeshData2D(); + /** @brief Move assignment */ + MeshData2D& operator=(MeshData2D&&) = default; + /** @brief Primitive */ inline Mesh::Primitive primitive() const { return _primitive; } diff --git a/src/Trade/MeshData3D.h b/src/Trade/MeshData3D.h index cf454d968..0d83b152a 100644 --- a/src/Trade/MeshData3D.h +++ b/src/Trade/MeshData3D.h @@ -35,9 +35,7 @@ type. */ class MAGNUM_EXPORT MeshData3D { MeshData3D(const MeshData3D& other) = delete; - MeshData3D(MeshData3D&& other) = delete; MeshData3D& operator=(const MeshData3D& other) = delete; - MeshData3D& operator=(MeshData3D&& other) = delete; public: /** @@ -53,9 +51,15 @@ class MAGNUM_EXPORT MeshData3D { */ inline MeshData3D(Mesh::Primitive primitive, std::vector* indices, std::vector*> positions, std::vector*> normals, std::vector*> textureCoords2D): _primitive(primitive), _indices(indices), _positions(positions), _normals(normals), _textureCoords2D(textureCoords2D) {} + /** @brief Move constructor */ + MeshData3D(MeshData3D&&) = default; + /** @brief Destructor */ ~MeshData3D(); + /** @brief Move assignment */ + MeshData3D& operator=(MeshData3D&&) = default; + /** @brief Primitive */ inline Mesh::Primitive primitive() const { return _primitive; }