Browse Source

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.
pull/7/head
Vladimír Vondruš 13 years ago
parent
commit
547c8a24da
  1. 8
      src/Trade/MeshData2D.h
  2. 8
      src/Trade/MeshData3D.h

8
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<std::uint32_t>* indices, std::vector<std::vector<Point2D>*> positions, std::vector<std::vector<Vector2>*> 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; }

8
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<std::uint32_t>* indices, std::vector<std::vector<Point3D>*> positions, std::vector<std::vector<Vector3>*> normals, std::vector<std::vector<Vector2>*> 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; }

Loading…
Cancel
Save