From e7f81160ac4f1ceb199f947fe619a2278f6dc3dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 17 Mar 2013 22:20:34 +0100 Subject: [PATCH] GCC 4.4 compatibility: can't default move constructor. Not sure why, similar issue to defaulted move assignment in GCC 4.5. --- src/Trade/MeshData2D.cpp | 6 ++++++ src/Trade/MeshData3D.cpp | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/src/Trade/MeshData2D.cpp b/src/Trade/MeshData2D.cpp index c299e855e..96ec803ba 100644 --- a/src/Trade/MeshData2D.cpp +++ b/src/Trade/MeshData2D.cpp @@ -30,7 +30,13 @@ namespace Magnum { namespace Trade { MeshData2D::MeshData2D(Mesh::Primitive primitive, std::vector* indices, std::vector*> positions, std::vector*> textureCoords2D): _primitive(primitive), _indices(indices), _positions(std::move(positions)), _textureCoords2D(std::move(textureCoords2D)) {} +#ifndef CORRADE_GCC44_COMPATIBILITY MeshData2D::MeshData2D(MeshData2D&&) = default; +#else +MeshData2D::MeshData2D(MeshData2D&& other): _primitive(other._primitive), _indices(other._indices), _positions(std::move(other._positions)), _textureCoords2D(std::move(other._textureCoords2D)) { + other._indices = nullptr; +} +#endif #ifndef CORRADE_GCC45_COMPATIBILITY MeshData2D& MeshData2D::operator=(MeshData2D&&) = default; diff --git a/src/Trade/MeshData3D.cpp b/src/Trade/MeshData3D.cpp index 7438616ee..c619a5ae8 100644 --- a/src/Trade/MeshData3D.cpp +++ b/src/Trade/MeshData3D.cpp @@ -30,7 +30,13 @@ namespace Magnum { namespace Trade { MeshData3D::MeshData3D(Mesh::Primitive primitive, std::vector* indices, std::vector*> positions, std::vector*> normals, std::vector*> textureCoords2D): _primitive(primitive), _indices(indices), _positions(std::move(positions)), _normals(std::move(normals)), _textureCoords2D(std::move(textureCoords2D)) {} +#ifndef CORRADE_GCC44_COMPATIBILITY MeshData3D::MeshData3D(MeshData3D&&) = default; +#else +MeshData3D::MeshData3D(MeshData3D&& other): _primitive(other._primitive), _indices(other._indices), _positions(std::move(other._positions)), _normals(std::move(other._normals)), _textureCoords2D(std::move(other._textureCoords2D)) { + other._indices = nullptr; +} +#endif #ifndef CORRADE_GCC45_COMPATIBILITY MeshData3D& MeshData3D::operator=(MeshData3D&&) = default;