From bafe501cbc6f3768ee2128a423aa25b7ed9e5a5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 17 Mar 2013 21:01:04 +0100 Subject: [PATCH] GCC 4.5 compatibility: can't default operator=(). Not sure why, as the implementation is trivial. --- src/Trade/MeshData2D.cpp | 11 +++++++++++ src/Trade/MeshData3D.cpp | 12 ++++++++++++ 2 files changed, 23 insertions(+) diff --git a/src/Trade/MeshData2D.cpp b/src/Trade/MeshData2D.cpp index 4ce061e15..c299e855e 100644 --- a/src/Trade/MeshData2D.cpp +++ b/src/Trade/MeshData2D.cpp @@ -32,7 +32,18 @@ MeshData2D::MeshData2D(Mesh::Primitive primitive, std::vector* indi MeshData2D::MeshData2D(MeshData2D&&) = default; +#ifndef CORRADE_GCC45_COMPATIBILITY MeshData2D& MeshData2D::operator=(MeshData2D&&) = default; +#else +MeshData2D& MeshData2D::operator=(MeshData2D&& other) { + std::swap(_primitive, other._primitive); + std::swap(_indices, other._indices); + std::swap(_positions, other._positions); + std::swap(_textureCoords2D, other._textureCoords2D); + + return *this; +} +#endif MeshData2D::~MeshData2D() { delete _indices; diff --git a/src/Trade/MeshData3D.cpp b/src/Trade/MeshData3D.cpp index d3794c15a..7438616ee 100644 --- a/src/Trade/MeshData3D.cpp +++ b/src/Trade/MeshData3D.cpp @@ -32,7 +32,19 @@ MeshData3D::MeshData3D(Mesh::Primitive primitive, std::vector* indi MeshData3D::MeshData3D(MeshData3D&&) = default; +#ifndef CORRADE_GCC45_COMPATIBILITY MeshData3D& MeshData3D::operator=(MeshData3D&&) = default; +#else +MeshData3D& MeshData3D::operator=(MeshData3D&& other) { + std::swap(_primitive, other._primitive); + std::swap(_indices, other._indices); + std::swap(_positions, other._positions); + std::swap(_normals, other._normals); + std::swap(_textureCoords2D, other._textureCoords2D); + + return *this; +} +#endif MeshData3D::~MeshData3D() { delete _indices;