Browse Source

GCC 4.5 compatibility: can't default operator=().

Not sure why, as the implementation is trivial.
Vladimír Vondruš 13 years ago
parent
commit
bafe501cbc
  1. 11
      src/Trade/MeshData2D.cpp
  2. 12
      src/Trade/MeshData3D.cpp

11
src/Trade/MeshData2D.cpp

@ -32,7 +32,18 @@ MeshData2D::MeshData2D(Mesh::Primitive primitive, std::vector<UnsignedInt>* 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;

12
src/Trade/MeshData3D.cpp

@ -32,7 +32,19 @@ MeshData3D::MeshData3D(Mesh::Primitive primitive, std::vector<UnsignedInt>* 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;

Loading…
Cancel
Save