Browse Source

GCC 4.5 compatibility: inherited move semantics somehow doesn't work.

We need to explicitly delete copy constructors (otherwise
std::is_constructible<A, const A&>::value is true) and add passthrough
move constructors. WHY.
Vladimír Vondruš 13 years ago
parent
commit
199428864f
  1. 10
      src/BufferTexture.h
  2. 10
      src/CubeMapTexture.h
  3. 10
      src/CubeMapTextureArray.h
  4. 30
      src/Query.h
  5. 10
      src/Test/AbstractShaderProgramGLTest.cpp
  6. 10
      src/Texture.h

10
src/BufferTexture.h

@ -217,6 +217,16 @@ class MAGNUM_EXPORT BufferTexture: private AbstractTexture {
explicit BufferTexture(): AbstractTexture(GL_TEXTURE_BUFFER) {}
#ifdef CORRADE_GCC45_COMPATIBILITY
BufferTexture(const BufferTexture&) = delete;
BufferTexture(BufferTexture&& other) = default;
BufferTexture& operator=(const BufferTexture&) = delete;
BufferTexture& operator=(BufferTexture&& other) {
AbstractTexture::operator=(std::move(other));
return *this;
}
#endif
/** @copydoc AbstractTexture::id() */
Int id() const { return AbstractTexture::id(); }

10
src/CubeMapTexture.h

@ -96,6 +96,16 @@ class CubeMapTexture: public AbstractTexture {
*/
explicit CubeMapTexture(): AbstractTexture(GL_TEXTURE_CUBE_MAP) {}
#ifdef CORRADE_GCC45_COMPATIBILITY
CubeMapTexture(const CubeMapTexture&) = delete;
CubeMapTexture(CubeMapTexture&&) = default;
CubeMapTexture& operator=(CubeMapTexture&) = delete;
CubeMapTexture& operator=(CubeMapTexture&& other) {
AbstractTexture::operator=(std::move(other));
return *this;
}
#endif
/**
* @brief Set wrapping
*

10
src/CubeMapTextureArray.h

@ -87,6 +87,16 @@ class CubeMapTextureArray: public AbstractTexture {
*/
explicit CubeMapTextureArray(): AbstractTexture(GL_TEXTURE_CUBE_MAP_ARRAY) {}
#ifdef CORRADE_GCC45_COMPATIBILITY
CubeMapTextureArray(const CubeMapTextureArray&) = delete;
CubeMapTextureArray(CubeMapTextureArray&&) = default;
CubeMapTextureArray& operator=(const CubeMapTextureArray&) = delete;
CubeMapTextureArray& operator=(CubeMapTextureArray&& other) {
AbstractTexture::operator=(std::move(other));
return *this;
}
#endif
/**
* @brief Set wrapping
*

30
src/Query.h

@ -194,6 +194,16 @@ class PrimitiveQuery: public AbstractQuery {
explicit PrimitiveQuery() {}
#ifdef CORRADE_GCC45_COMPATIBILITY
PrimitiveQuery(const PrimitiveQuery&) = delete;
PrimitiveQuery(PrimitiveQuery&&) = default;
PrimitiveQuery& operator=(const PrimitiveQuery&) = delete;
PrimitiveQuery& operator=(PrimitiveQuery&& other) {
AbstractQuery::operator=(std::move(other));
return *this;
}
#endif
/**
* @brief Begin query
*
@ -322,6 +332,16 @@ class SampleQuery: public AbstractQuery {
explicit SampleQuery() {}
#ifdef CORRADE_GCC45_COMPATIBILITY
SampleQuery(const SampleQuery&) = delete;
SampleQuery(SampleQuery&&) = default;
SampleQuery& operator=(const SampleQuery&) = delete;
SampleQuery& operator=(SampleQuery&& other) {
AbstractQuery::operator=(std::move(other));
return *this;
}
#endif
/** @copydoc PrimitiveQuery::begin() */
void begin(Target target) {
AbstractQuery::begin(GLenum(target));
@ -408,6 +428,16 @@ class TimeQuery: public AbstractQuery {
explicit TimeQuery() {}
#ifdef CORRADE_GCC45_COMPATIBILITY
TimeQuery(const TimeQuery&) = delete;
TimeQuery(TimeQuery&&) = default;
TimeQuery& operator=(const TimeQuery&) = delete;
TimeQuery& operator=(TimeQuery&& other) {
AbstractQuery::operator=(std::move(other));
return *this;
}
#endif
/**
* @brief Query timestamp
*

10
src/Test/AbstractShaderProgramGLTest.cpp

@ -53,6 +53,16 @@ namespace {
class MyShader: public AbstractShaderProgram {
public:
explicit MyShader() {}
#ifdef CORRADE_GCC45_COMPATIBILITY
MyShader(const MyShader&) = delete;
MyShader(MyShader&&) = default;
MyShader& operator=(const MyShader&) = delete;
MyShader& operator=(MyShader&& other) {
AbstractShaderProgram::operator=(std::move(other));
return *this;
}
#endif
};
}

10
src/Texture.h

@ -229,6 +229,16 @@ template<UnsignedInt dimensions> class Texture: public AbstractTexture {
*/
explicit Texture(Target target = DataHelper<Dimensions>::target()): AbstractTexture(GLenum(target)) {}
#ifdef CORRADE_GCC45_COMPATIBILITY
Texture(const Texture<dimensions>&) = delete;
Texture(Texture<dimensions>&&) = default;
Texture<dimensions>& operator=(const Texture<dimensions>&) = delete;
Texture<dimensions>& operator=(Texture<dimensions>&& other) {
AbstractTexture::operator=(std::move(other));
return *this;
}
#endif
/** @brief %Texture target */
constexpr Target target() const { return static_cast<Target>(_target); }

Loading…
Cancel
Save