Browse Source

Dropped GCC 4.6 support.

pull/59/head
Vladimír Vondruš 12 years ago
parent
commit
a9a5ead13d
  1. 4
      CMakeLists.txt
  2. 6
      README.md
  3. 8
      doc/building.dox
  4. 2
      doc/portability.dox
  5. 56
      package/archlinux/PKGBUILD-gcc46
  6. 1
      package/ci/jenkins-gltests.xml
  7. 1
      package/ci/jenkins.xml
  8. 7
      src/CMakeLists.txt
  9. 6
      src/Magnum/Array.h
  10. 4
      src/Magnum/Context.cpp
  11. 9
      src/Magnum/DebugTools/ForceRenderer.cpp
  12. 2
      src/Magnum/DebugTools/Implementation/AxisAlignedBoxRenderer.h
  13. 2
      src/Magnum/DebugTools/Implementation/BoxRenderer.h
  14. 2
      src/Magnum/DebugTools/Implementation/CapsuleRenderer.h
  15. 2
      src/Magnum/DebugTools/Implementation/CylinderRenderer.h
  16. 2
      src/Magnum/DebugTools/Implementation/LineSegmentRenderer.h
  17. 2
      src/Magnum/DebugTools/Implementation/PointRenderer.h
  18. 2
      src/Magnum/DebugTools/Implementation/SphereRenderer.h
  19. 88
      src/Magnum/Magnum.h
  20. 8
      src/Magnum/Math/Angle.h
  21. 6
      src/Magnum/Math/BoolVector.h
  22. 6
      src/Magnum/Math/Math.h
  23. 14
      src/Magnum/Math/Matrix.h
  24. 3
      src/Magnum/Math/Range.h
  25. 27
      src/Magnum/Math/RectangularMatrix.h
  26. 4
      src/Magnum/Math/Test/AngleTest.cpp
  27. 8
      src/Magnum/Math/Test/BoolVectorTest.cpp
  28. 10
      src/Magnum/Math/Test/Matrix3Test.cpp
  29. 10
      src/Magnum/Math/Test/Matrix4Test.cpp
  30. 10
      src/Magnum/Math/Test/MatrixTest.cpp
  31. 23
      src/Magnum/Math/Test/RangeTest.cpp
  32. 15
      src/Magnum/Math/Test/RectangularMatrixTest.cpp
  33. 15
      src/Magnum/Math/Test/Vector2Test.cpp
  34. 15
      src/Magnum/Math/Test/Vector3Test.cpp
  35. 15
      src/Magnum/Math/Test/Vector4Test.cpp
  36. 20
      src/Magnum/Math/Test/VectorTest.cpp
  37. 24
      src/Magnum/Math/Vector.h
  38. 4
      src/Magnum/MeshTools/CombineIndexedArrays.cpp
  39. 4
      src/Magnum/MeshTools/RemoveDuplicates.h
  40. 9
      src/Magnum/MeshTools/Test/TransformTest.cpp
  41. 2
      src/Magnum/Platform/Implementation/EglContextHandler.h
  42. 2
      src/Magnum/Platform/Implementation/GlxContextHandler.h
  43. 1
      src/Magnum/Platform/NaClApplication.h
  44. 1
      src/Magnum/Platform/WindowlessNaClApplication.h
  45. 4
      src/Magnum/Platform/magnum-info.cpp
  46. 4
      src/Magnum/ResourceManager.h
  47. 14
      src/Magnum/SceneGraph/AbstractCamera.h
  48. 23
      src/Magnum/SceneGraph/AbstractFeature.h
  49. 10
      src/Magnum/SceneGraph/AbstractGroupedFeature.h
  50. 10
      src/Magnum/SceneGraph/AbstractObject.h
  51. 16
      src/Magnum/SceneGraph/AbstractTransformation.h
  52. 16
      src/Magnum/SceneGraph/AbstractTranslation.h
  53. 14
      src/Magnum/SceneGraph/Animable.h
  54. 14
      src/Magnum/SceneGraph/AnimableGroup.h
  55. 7
      src/Magnum/SceneGraph/Camera2D.h
  56. 7
      src/Magnum/SceneGraph/Camera3D.h
  57. 40
      src/Magnum/SceneGraph/Drawable.h
  58. 10
      src/Magnum/SceneGraph/FeatureGroup.h
  59. 54
      src/Magnum/SceneGraph/SceneGraph.h
  60. 16
      src/Magnum/SceneGraph/TranslationTransformation.h
  61. 1
      src/Magnum/Shapes/shapeImplementation.h
  62. 1
      src/Magnum/Test/AbstractOpenGLTester.h
  63. 3
      src/Magnum/Test/AbstractQueryGLTest.cpp
  64. 3
      src/Magnum/Test/AbstractShaderProgramGLTest.cpp
  65. 3
      src/Magnum/Test/AbstractTextureGLTest.cpp
  66. 4
      src/Magnum/Test/ArrayTest.cpp
  67. 3
      src/Magnum/Test/BufferGLTest.cpp
  68. 3
      src/Magnum/Test/BufferImageGLTest.cpp
  69. 15
      src/Magnum/Test/ColorTest.cpp
  70. 3
      src/Magnum/Test/FramebufferGLTest.cpp
  71. 3
      src/Magnum/Test/ImageTest.cpp
  72. 3
      src/Magnum/Test/MeshGLTest.cpp
  73. 3
      src/Magnum/Test/RenderbufferGLTest.cpp
  74. 1
      src/Magnum/Test/ResourceManagerTest.cpp
  75. 3
      src/Magnum/Test/ShaderGLTest.cpp
  76. 3
      src/Magnum/Trade/Test/ImageDataTest.cpp
  77. 8
      src/MagnumPlugins/MagnumFont/MagnumFont.cpp
  78. 8
      src/MagnumPlugins/MagnumFontConverter/MagnumFontConverter.cpp
  79. 8
      src/MagnumPlugins/ObjImporter/ObjImporter.cpp

4
CMakeLists.txt

@ -108,8 +108,8 @@ if(BUILD_TESTS)
endif() endif()
# Check compiler compatibility # Check compiler compatibility
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND "${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS "4.6.0") if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND "${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS "4.7.0")
message(FATAL_ERROR "Compatibility branch of Magnum is needed for use with GCC < 4.6. See the documentation for more information.") message(FATAL_ERROR "Compatibility branch of Magnum is needed for use with GCC < 4.7. See the documentation for more information.")
elseif(MSVC) elseif(MSVC)
message(FATAL_ERROR "Compatibility branch of Magnum is needed for use with MSVC. See the documentation for more information.") message(FATAL_ERROR "Compatibility branch of Magnum is needed for use with MSVC. See the documentation for more information.")
endif() endif()

6
README.md

@ -84,9 +84,9 @@ Minimal dependencies
-------------------- --------------------
* C++ compiler with good C++11 support. Currently there are two compilers * C++ compiler with good C++11 support. Currently there are two compilers
which are tested to have everything needed: **GCC** >= 4.6 and **Clang** which are tested to have everything needed: **GCC** >= 4.7 and **Clang**
>= 3.1. On Windows you can use **MinGW**. GCC 4.5, 4.4 and **MSVC** 2013 >= 3.1. On Windows you can use **MinGW**. GCC 4.6, 4.5, 4.4 and **MSVC**
support involves some ugly workarounds and thus is available only in 2013 support involves some ugly workarounds and thus is available only in
`compatibility` branch. `compatibility` branch.
* **CMake** >= 2.8.8 * **CMake** >= 2.8.8
* **Corrade** - Plugin management and utility library. You can get it at * **Corrade** - Plugin management and utility library. You can get it at

8
doc/building.dox

@ -33,9 +33,9 @@ namespace Magnum {
Minimal set of tools and libraries required for building is: Minimal set of tools and libraries required for building is:
- C++ compiler with good C++11 support. Currently there are two compilers - C++ compiler with good C++11 support. Currently there are two compilers
which are tested to have everything needed: **GCC** >= 4.6 and **Clang** which are tested to have everything needed: **GCC** >= 4.7 and **Clang**
>= 3.1. On Windows you can use **MinGW**. GCC 4.5, 4.4 and **MSVC** 2013 >= 3.1. On Windows you can use **MinGW**. GCC 4.6, 4.5, 4.4 and **MSVC**
support involves some ugly workarounds and thus is available only in 2013 support involves some ugly workarounds and thus is available only in
`compatibility` branch. `compatibility` branch.
- **CMake** >= 2.8.8 - **CMake** >= 2.8.8
- **Corrade** - Plugin management and utility library. See - **Corrade** - Plugin management and utility library. See
@ -493,7 +493,7 @@ or `update-job`).
Build is done using **Ninja** build system and everything possible is enabled, Build is done using **Ninja** build system and everything possible is enabled,
thus you need also **SDL2**, **GLUT** and **OpenAL** libraries. It expects that thus you need also **SDL2**, **GLUT** and **OpenAL** libraries. It expects that
**GCC** >=4.8.2, 4.7, 4.6 and **Clang** are installed and there are **OpenGL**, **GCC** >=4.8.2, 4.7 and **Clang** are installed and there are **OpenGL**,
**OpenGL ES 2.0** and **OpenGL ES 3.0** librares as it tries to compile the **OpenGL ES 2.0** and **OpenGL ES 3.0** librares as it tries to compile the
library with every combination of them. You can add/remove the axes in library with every combination of them. You can add/remove the axes in
`axes/hudson.matrix.TextAxis` or via the web interface later. `axes/hudson.matrix.TextAxis` or via the web interface later.

2
doc/portability.dox

@ -70,7 +70,7 @@ for more information.
Each feature is marked accordingly if it is not available on some compilers, Each feature is marked accordingly if it is not available on some compilers,
see @ref SceneGraph::DrawableGroup3D for an example. It is up to you (or your see @ref SceneGraph::DrawableGroup3D for an example. It is up to you (or your
platform) which compiler your code will support, code written for e.g. GCC 4.6 platform) which compiler your code will support, code written for e.g. GCC 4.7
will work also on Magnum compiled with support for newer compilers, although will work also on Magnum compiled with support for newer compilers, although
newer compilers may catch errors that weren't spotted by earlier versions. newer compilers may catch errors that weren't spotted by earlier versions.

56
package/archlinux/PKGBUILD-gcc46

@ -1,56 +0,0 @@
# Author: mosra <mosra@centrum.cz>
pkgname=magnum
pkgver=dev.gcc46
pkgrel=1
pkgdesc="C++11 and OpenGL 2D/3D graphics engine (built with GCC 4.6)"
arch=('i686' 'x86_64')
url="http://mosra.cz/blog/magnum.php"
license=('MIT')
depends=('corrade' 'openal' 'freeglut' 'sdl2')
makedepends=('cmake' 'ninja' 'gcc46')
options=('!strip' 'staticlibs')
provides=('magnum-git')
build() {
if [ ! -d "$startdir/build-gcc46" ] ; then
mkdir "$startdir/build-gcc46"
cd "$startdir/build-gcc46"
cmake .. \
-DCMAKE_CXX_COMPILER=g++-4.6 \
-G Ninja
fi
cd "$startdir/build-gcc46"
cmake .. \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_INSTALL_PREFIX=/usr \
-DWITH_AUDIO=ON \
-DWITH_GLUTAPPLICATION=ON \
-DWITH_GLXAPPLICATION=ON \
-DWITH_SDL2APPLICATION=ON \
-DWITH_WINDOWLESSGLXAPPLICATION=ON \
-DWITH_MAGNUMFONT=ON \
-DWITH_MAGNUMFONTCONVERTER=ON \
-DWITH_OBJIMPORTER=ON \
-DWITH_TGAIMAGECONVERTER=ON \
-DWITH_TGAIMPORTER=ON \
-DWITH_WAVAUDIOIMPORTER=ON \
-DWITH_DISTANCEFIELDCONVERTER=ON \
-DWITH_FONTCONVERTER=ON \
-DWITH_MAGNUMINFO=ON \
-DBUILD_TESTS=ON \
-DBUILD_GL_TESTS=ON
ninja
}
check() {
cd "$startdir/build-gcc46"
ctest --output-on-failure -j5
}
package() {
cd "$startdir/build-gcc46"
DESTDIR="$pkgdir/" ninja install
}

1
package/ci/jenkins-gltests.xml

@ -52,7 +52,6 @@
<values> <values>
<string>g++</string> <string>g++</string>
<string>g++-4.7</string> <string>g++-4.7</string>
<string>g++-4.6</string>
<string>clang++</string> <string>clang++</string>
<string>clang++-libc++</string> <string>clang++-libc++</string>
</values> </values>

1
package/ci/jenkins.xml

@ -54,7 +54,6 @@
<values> <values>
<string>g++</string> <string>g++</string>
<string>g++-4.7</string> <string>g++-4.7</string>
<string>g++-4.6</string>
<string>clang++</string> <string>clang++</string>
<string>clang++-libc++</string> <string>clang++-libc++</string>
</values> </values>

7
src/CMakeLists.txt

@ -23,13 +23,6 @@
# DEALINGS IN THE SOFTWARE. # DEALINGS IN THE SOFTWARE.
# #
# Disable `-pedantic` for GCC 4.6, as the compiler doesn't like
# list-initialization of array of classes (RectangularMatrix constructors). It
# is perfectly legal C++11 and both GCC 4.7 and Clang accept it without notice.
if(CORRADE_GCC46_COMPATIBILITY)
string(REPLACE "-pedantic" "" CORRADE_CXX_FLAGS "${CORRADE_CXX_FLAGS}")
endif()
# On 4.8.2 strict aliasing causes failure of DebugToolsCylinderRendererTest # On 4.8.2 strict aliasing causes failure of DebugToolsCylinderRendererTest
# without any warning, only in release build, any attempt to add debug print # without any warning, only in release build, any attempt to add debug print
# results in issue disappearing. Not an issue on Clang or GCC < 4.8. # results in issue disappearing. Not an issue on Clang or GCC < 4.8.

6
src/Magnum/Array.h

@ -73,13 +73,7 @@ template<UnsignedInt dimensions, class T> class Array {
#ifdef DOXYGEN_GENERATING_OUTPUT #ifdef DOXYGEN_GENERATING_OUTPUT
constexpr /*implicit*/ Array(T value); constexpr /*implicit*/ Array(T value);
#else #else
#ifndef CORRADE_GCC46_COMPATIBILITY
template<class U, class V = typename std::enable_if<std::is_same<T, U>::value && dimensions != 1, T>::type> constexpr /*implicit*/ Array(U value): Array(typename Math::Implementation::GenerateSequence<dimensions>::Type(), value) {} template<class U, class V = typename std::enable_if<std::is_same<T, U>::value && dimensions != 1, T>::type> constexpr /*implicit*/ Array(U value): Array(typename Math::Implementation::GenerateSequence<dimensions>::Type(), value) {}
#else
template<class U, class V = typename std::enable_if<std::is_same<T, U>::value && dimensions != 1, T>::type> /*implicit*/ Array(U value) {
*this = Array(typename Math::Implementation::GenerateSequence<dimensions>::Type(), value);
}
#endif
#endif #endif
/** @brief Equality */ /** @brief Equality */

4
src/Magnum/Context.cpp

@ -424,11 +424,7 @@ Context::Context() {
std::unordered_map<std::string, Extension> futureExtensions; std::unordered_map<std::string, Extension> futureExtensions;
for(std::size_t i = future; i != versions.size(); ++i) for(std::size_t i = future; i != versions.size(); ++i)
for(const Extension& extension: Extension::extensions(versions[i])) for(const Extension& extension: Extension::extensions(versions[i]))
#ifndef CORRADE_GCC46_COMPATIBILITY
futureExtensions.emplace(extension._string, extension); futureExtensions.emplace(extension._string, extension);
#else
futureExtensions.insert({extension._string, extension});
#endif
/* Check for presence of future and vendor extensions */ /* Check for presence of future and vendor extensions */
const std::vector<std::string> extensions = extensionStrings(); const std::vector<std::string> extensions = extensionStrings();

9
src/Magnum/DebugTools/ForceRenderer.cpp

@ -41,23 +41,14 @@ template<UnsignedInt dimensions> ResourceKey shaderKey();
template<> inline ResourceKey shaderKey<2>() { return ResourceKey("FlatShader2D"); } template<> inline ResourceKey shaderKey<2>() { return ResourceKey("FlatShader2D"); }
template<> inline ResourceKey shaderKey<3>() { return ResourceKey("FlatShader3D"); } template<> inline ResourceKey shaderKey<3>() { return ResourceKey("FlatShader3D"); }
/** @bug Why this is not constexpr under GCC 4.6? */
#ifndef CORRADE_GCC46_COMPATIBILITY
constexpr std::array<Vector2, 4> positions{{ constexpr std::array<Vector2, 4> positions{{
#else
const std::array<Vector2, 4> positions{{
#endif
{0.0f, 0.0f}, {0.0f, 0.0f},
{1.0f, 0.0f}, {1.0f, 0.0f},
{0.9f, 0.1f}, {0.9f, 0.1f},
{0.9f, -0.1f} {0.9f, -0.1f}
}}; }};
#ifndef CORRADE_GCC46_COMPATIBILITY
constexpr std::array<UnsignedByte, 6> indices{{ constexpr std::array<UnsignedByte, 6> indices{{
#else
const std::array<UnsignedByte, 6> indices{{
#endif
0, 1, 0, 1,
1, 2, 1, 2,
1, 3 1, 3

2
src/Magnum/DebugTools/Implementation/AxisAlignedBoxRenderer.h

@ -25,8 +25,6 @@
DEALINGS IN THE SOFTWARE. DEALINGS IN THE SOFTWARE.
*/ */
#include <Corrade/compatibility.h>
#include "Magnum/Shapes/Shapes.h" #include "Magnum/Shapes/Shapes.h"
#include "AbstractBoxRenderer.h" #include "AbstractBoxRenderer.h"

2
src/Magnum/DebugTools/Implementation/BoxRenderer.h

@ -25,8 +25,6 @@
DEALINGS IN THE SOFTWARE. DEALINGS IN THE SOFTWARE.
*/ */
#include <Corrade/compatibility.h>
#include "Magnum/Shapes/Shapes.h" #include "Magnum/Shapes/Shapes.h"
#include "AbstractBoxRenderer.h" #include "AbstractBoxRenderer.h"

2
src/Magnum/DebugTools/Implementation/CapsuleRenderer.h

@ -25,8 +25,6 @@
DEALINGS IN THE SOFTWARE. DEALINGS IN THE SOFTWARE.
*/ */
#include <Corrade/compatibility.h>
#include "Magnum/Shapes/Shapes.h" #include "Magnum/Shapes/Shapes.h"
#include "AbstractShapeRenderer.h" #include "AbstractShapeRenderer.h"

2
src/Magnum/DebugTools/Implementation/CylinderRenderer.h

@ -25,8 +25,6 @@
DEALINGS IN THE SOFTWARE. DEALINGS IN THE SOFTWARE.
*/ */
#include <Corrade/compatibility.h>
#include "Magnum/Shapes/Shapes.h" #include "Magnum/Shapes/Shapes.h"
#include "AbstractShapeRenderer.h" #include "AbstractShapeRenderer.h"

2
src/Magnum/DebugTools/Implementation/LineSegmentRenderer.h

@ -25,8 +25,6 @@
DEALINGS IN THE SOFTWARE. DEALINGS IN THE SOFTWARE.
*/ */
#include <Corrade/compatibility.h>
#include "Magnum/Shapes/Shapes.h" #include "Magnum/Shapes/Shapes.h"
#include "AbstractShapeRenderer.h" #include "AbstractShapeRenderer.h"

2
src/Magnum/DebugTools/Implementation/PointRenderer.h

@ -25,8 +25,6 @@
DEALINGS IN THE SOFTWARE. DEALINGS IN THE SOFTWARE.
*/ */
#include <Corrade/compatibility.h>
#include "Magnum/Shapes/Shapes.h" #include "Magnum/Shapes/Shapes.h"
#include "AbstractShapeRenderer.h" #include "AbstractShapeRenderer.h"

2
src/Magnum/DebugTools/Implementation/SphereRenderer.h

@ -25,8 +25,6 @@
DEALINGS IN THE SOFTWARE. DEALINGS IN THE SOFTWARE.
*/ */
#include <Corrade/compatibility.h>
#include "Magnum/Shapes/Shapes.h" #include "Magnum/Shapes/Shapes.h"
#include "AbstractShapeRenderer.h" #include "AbstractShapeRenderer.h"

88
src/Magnum/Magnum.h

@ -49,7 +49,6 @@ namespace Math {
/** @todoc Remove `ifndef` when Doxygen is able to handle operator"" */ /** @todoc Remove `ifndef` when Doxygen is able to handle operator"" */
#ifndef DOXYGEN_GENERATING_OUTPUT #ifndef DOXYGEN_GENERATING_OUTPUT
#ifndef CORRADE_GCC46_COMPATIBILITY
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
constexpr Rad<Double> operator "" _rad(long double); constexpr Rad<Double> operator "" _rad(long double);
constexpr Deg<Double> operator "" _deg(long double); constexpr Deg<Double> operator "" _deg(long double);
@ -57,7 +56,6 @@ namespace Math {
constexpr Rad<Float> operator "" _radf(long double); constexpr Rad<Float> operator "" _radf(long double);
constexpr Deg<Float> operator "" _degf(long double); constexpr Deg<Float> operator "" _degf(long double);
#endif #endif
#endif
} }
/* Bring whole Corrade namespace */ /* Bring whole Corrade namespace */
@ -228,11 +226,7 @@ typedef Math::Matrix3<Float> Matrix3;
typedef Math::Matrix4<Float> Matrix4; typedef Math::Matrix4<Float> Matrix4;
/** @brief 2x2 float matrix */ /** @brief 2x2 float matrix */
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef Math::Matrix2x2<Float> Matrix2x2; typedef Math::Matrix2x2<Float> Matrix2x2;
#else
typedef Math::Matrix<2, Float> Matrix2x2;
#endif
/** /**
@brief 3x3 float matrix @brief 3x3 float matrix
@ -240,11 +234,7 @@ typedef Math::Matrix<2, Float> Matrix2x2;
Note that this is different from @ref Matrix3, which contains additional Note that this is different from @ref Matrix3, which contains additional
functions for transformations in 2D. functions for transformations in 2D.
*/ */
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef Math::Matrix3x3<Float> Matrix3x3; typedef Math::Matrix3x3<Float> Matrix3x3;
#else
typedef Math::Matrix<3, Float> Matrix3x3;
#endif
/** /**
@brief 4x4 float matrix @brief 4x4 float matrix
@ -252,53 +242,25 @@ typedef Math::Matrix<3, Float> Matrix3x3;
Note that this is different from @ref Matrix4, which contains additional Note that this is different from @ref Matrix4, which contains additional
functions for transformations in 3D. functions for transformations in 3D.
*/ */
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef Math::Matrix4x4<Float> Matrix4x4; typedef Math::Matrix4x4<Float> Matrix4x4;
#else
typedef Math::Matrix<4, Float> Matrix4x4;
#endif
/** @brief Float matrix with 2 columns and 3 rows */ /** @brief Float matrix with 2 columns and 3 rows */
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef Math::Matrix2x3<Float> Matrix2x3; typedef Math::Matrix2x3<Float> Matrix2x3;
#else
typedef Math::RectangularMatrix<2, 3, Float> Matrix2x3;
#endif
/** @brief Float matrix with 3 columns and 2 rows */ /** @brief Float matrix with 3 columns and 2 rows */
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef Math::Matrix3x2<Float> Matrix3x2; typedef Math::Matrix3x2<Float> Matrix3x2;
#else
typedef Math::RectangularMatrix<3, 2, Float> Matrix3x2;
#endif
/** @brief Float matrix with 2 columns and 4 rows */ /** @brief Float matrix with 2 columns and 4 rows */
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef Math::Matrix2x4<Float> Matrix2x4; typedef Math::Matrix2x4<Float> Matrix2x4;
#else
typedef Math::RectangularMatrix<2, 4, Float> Matrix2x4;
#endif
/** @brief Float matrix with 4 columns and 2 rows */ /** @brief Float matrix with 4 columns and 2 rows */
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef Math::Matrix4x2<Float> Matrix4x2; typedef Math::Matrix4x2<Float> Matrix4x2;
#else
typedef Math::RectangularMatrix<4, 2, Float> Matrix4x2;
#endif
/** @brief Float matrix with 3 columns and 4 rows */ /** @brief Float matrix with 3 columns and 4 rows */
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef Math::Matrix3x4<Float> Matrix3x4; typedef Math::Matrix3x4<Float> Matrix3x4;
#else
typedef Math::RectangularMatrix<3, 4, Float> Matrix3x4;
#endif
/** @brief Float matrix with 4 columns and 3 rows */ /** @brief Float matrix with 4 columns and 3 rows */
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef Math::Matrix4x3<Float> Matrix4x3; typedef Math::Matrix4x3<Float> Matrix4x3;
#else
typedef Math::RectangularMatrix<4, 3, Float> Matrix4x3;
#endif
/** @brief Float complex number */ /** @brief Float complex number */
typedef Math::Complex<Float> Complex; typedef Math::Complex<Float> Complex;
@ -322,11 +284,7 @@ typedef Math::Deg<Float> Deg;
typedef Math::Rad<Float> Rad; typedef Math::Rad<Float> Rad;
/** @brief Float 1D range */ /** @brief Float 1D range */
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef Math::Range1D<Float> Range1D; typedef Math::Range1D<Float> Range1D;
#else
typedef Math::Range<1, Float> Range1D;
#endif
/** @brief Float 2D range */ /** @brief Float 2D range */
typedef Math::Range2D<Float> Range2D; typedef Math::Range2D<Float> Range2D;
@ -335,11 +293,7 @@ typedef Math::Range2D<Float> Range2D;
typedef Math::Range3D<Float> Range3D; typedef Math::Range3D<Float> Range3D;
/** @brief Signed integer 1D range */ /** @brief Signed integer 1D range */
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef Math::Range1D<Int> Range1Di; typedef Math::Range1D<Int> Range1Di;
#else
typedef Math::Range<1, Int> Range1Di;
#endif
/** @brief Signed integer 2D range */ /** @brief Signed integer 2D range */
typedef Math::Range2D<Int> Range2Di; typedef Math::Range2D<Int> Range2Di;
@ -397,11 +351,7 @@ typedef Math::Matrix3<Double> Matrix3d;
typedef Math::Matrix4<Double> Matrix4d; typedef Math::Matrix4<Double> Matrix4d;
/** @brief 2x2 double matrix */ /** @brief 2x2 double matrix */
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef Math::Matrix2x2<Double> Matrix2x2d; typedef Math::Matrix2x2<Double> Matrix2x2d;
#else
typedef Math::Matrix<2, Double> Matrix2x2d;
#endif
/** /**
@brief 3x3 double matrix @brief 3x3 double matrix
@ -409,11 +359,7 @@ typedef Math::Matrix<2, Double> Matrix2x2d;
Note that this is different from @ref Matrix3d, which contains additional Note that this is different from @ref Matrix3d, which contains additional
functions for transformations in 2D. functions for transformations in 2D.
*/ */
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef Math::Matrix3x3<Double> Matrix3x3d; typedef Math::Matrix3x3<Double> Matrix3x3d;
#else
typedef Math::Matrix<3, Double> Matrix3x3d;
#endif
/** /**
@brief 4x4 double matrix @brief 4x4 double matrix
@ -421,53 +367,25 @@ typedef Math::Matrix<3, Double> Matrix3x3d;
Note that this is different from @ref Matrix4d, which contains additional Note that this is different from @ref Matrix4d, which contains additional
functions for transformations in 3D. functions for transformations in 3D.
*/ */
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef Math::Matrix4x4<Double> Matrix4x4d; typedef Math::Matrix4x4<Double> Matrix4x4d;
#else
typedef Math::Matrix<4, Double> Matrix4x4d;
#endif
/** @brief Double matrix with 2 columns and 3 rows */ /** @brief Double matrix with 2 columns and 3 rows */
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef Math::Matrix2x3<Double> Matrix2x3d; typedef Math::Matrix2x3<Double> Matrix2x3d;
#else
typedef Math::RectangularMatrix<2, 3, Double> Matrix2x3d;
#endif
/** @brief Double matrix with 3 columns and 2 rows */ /** @brief Double matrix with 3 columns and 2 rows */
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef Math::Matrix3x2<Double> Matrix3x2d; typedef Math::Matrix3x2<Double> Matrix3x2d;
#else
typedef Math::RectangularMatrix<3, 2, Double> Matrix3x2d;
#endif
/** @brief Double matrix with 2 columns and 4 rows */ /** @brief Double matrix with 2 columns and 4 rows */
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef Math::Matrix2x4<Double> Matrix2x4d; typedef Math::Matrix2x4<Double> Matrix2x4d;
#else
typedef Math::RectangularMatrix<2, 4, Double> Matrix2x4d;
#endif
/** @brief Double matrix with 4 columns and 2 rows */ /** @brief Double matrix with 4 columns and 2 rows */
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef Math::Matrix4x2<Double> Matrix4x2d; typedef Math::Matrix4x2<Double> Matrix4x2d;
#else
typedef Math::RectangularMatrix<4, 2, Double> Matrix4x2d;
#endif
/** @brief Double matrix with 3 columns and 4 rows */ /** @brief Double matrix with 3 columns and 4 rows */
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef Math::Matrix3x4<Double> Matrix3x4d; typedef Math::Matrix3x4<Double> Matrix3x4d;
#else
typedef Math::RectangularMatrix<3, 4, Double> Matrix3x4d;
#endif
/** @brief Double matrix with 4 columns and 3 rows */ /** @brief Double matrix with 4 columns and 3 rows */
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef Math::Matrix4x3<Double> Matrix4x3d; typedef Math::Matrix4x3<Double> Matrix4x3d;
#else
typedef Math::RectangularMatrix<4, 3, Double> Matrix4x3d;
#endif
/** @brief Double complex number */ /** @brief Double complex number */
typedef Math::Complex<Double> Complexd; typedef Math::Complex<Double> Complexd;
@ -491,11 +409,7 @@ typedef Math::Deg<Double> Degd;
typedef Math::Rad<Double> Radd; typedef Math::Rad<Double> Radd;
/** @brief Double 1D range */ /** @brief Double 1D range */
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef Math::Range1D<Double> Range1Dd; typedef Math::Range1D<Double> Range1Dd;
#else
typedef Math::Range<1, Double> Range1Dd;
#endif
/** @brief Double 2D range */ /** @brief Double 2D range */
typedef Math::Range2D<Double> Range2Dd; typedef Math::Range2D<Double> Range2Dd;
@ -514,7 +428,6 @@ typedef CORRADE_DEPRECATED("use Range2Dd instead") Math::Geometry::Rectangle<Dou
/*@}*/ /*@}*/
#endif #endif
#ifndef CORRADE_GCC46_COMPATIBILITY
/* Using angle literals from Math namespace */ /* Using angle literals from Math namespace */
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
using Math::operator "" _deg; using Math::operator "" _deg;
@ -522,7 +435,6 @@ using Math::operator "" _rad;
#endif #endif
using Math::operator "" _degf; using Math::operator "" _degf;
using Math::operator "" _radf; using Math::operator "" _radf;
#endif
/* Forward declarations for all types in root namespace */ /* Forward declarations for all types in root namespace */

8
src/Magnum/Math/Angle.h

@ -146,7 +146,6 @@ template<class T> class Deg: public Unit<Deg, T> {
constexpr /*implicit*/ Deg(Unit<Rad, T> value); constexpr /*implicit*/ Deg(Unit<Rad, T> value);
}; };
#ifndef CORRADE_GCC46_COMPATIBILITY
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
/** @relates Deg /** @relates Deg
@brief Double-precision degree value literal @brief Double-precision degree value literal
@ -157,7 +156,6 @@ Double cosine = Math::cos(60.0_deg); // cosine = 0.5
Double cosine = Math::cos(1.047_rad); // cosine = 0.5 Double cosine = Math::cos(1.047_rad); // cosine = 0.5
@endcode @endcode
@see Magnum::operator""_deg(), operator""_degf(), operator""_rad() @see Magnum::operator""_deg(), operator""_degf(), operator""_rad()
@note Not available on GCC < 4.7. Use @ref Deg::Deg(T) instead.
@requires_gl Only single-precision types are available in OpenGL ES. @requires_gl Only single-precision types are available in OpenGL ES.
@todoc Make references explicit when Doxygen can link to operator"" @todoc Make references explicit when Doxygen can link to operator""
*/ */
@ -173,12 +171,10 @@ Float tangent = Math::tan(60.0_degf); // tangent = 1.732f
Float tangent = Math::tan(1.047_radf); // tangent = 1.732f Float tangent = Math::tan(1.047_radf); // tangent = 1.732f
@endcode @endcode
@see Magnum::operator""_degf(), operator""_deg(), operator""_radf() @see Magnum::operator""_degf(), operator""_deg(), operator""_radf()
@note Not available on GCC < 4.7. Use @ref Deg::Deg(T) instead.
@requires_gl Only single-precision types are available in OpenGL ES. @requires_gl Only single-precision types are available in OpenGL ES.
@todoc Make references explicit when Doxygen can link to operator"" @todoc Make references explicit when Doxygen can link to operator""
*/ */
constexpr Deg<Float> operator "" _degf(long double value) { return Deg<Float>(value); } constexpr Deg<Float> operator "" _degf(long double value) { return Deg<Float>(value); }
#endif
/** /**
@brief Angle in radians @brief Angle in radians
@ -211,14 +207,12 @@ template<class T> class Rad: public Unit<Rad, T> {
constexpr /*implicit*/ Rad(Unit<Deg, T> value); constexpr /*implicit*/ Rad(Unit<Deg, T> value);
}; };
#ifndef CORRADE_GCC46_COMPATIBILITY
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
/** @relates Rad /** @relates Rad
@brief Double-precision radian value literal @brief Double-precision radian value literal
See operator""_rad() for more information. See operator""_rad() for more information.
@see Magnum::operator""_rad(), operator""_radf(), operator""_deg() @see Magnum::operator""_rad(), operator""_radf(), operator""_deg()
@note Not available on GCC < 4.7. Use @ref Rad::Rad(T) instead.
@todoc Make references explicit when Doxygen can link to operator"" @todoc Make references explicit when Doxygen can link to operator""
*/ */
constexpr Rad<Double> operator "" _rad(long double value) { return Rad<Double>(value); } constexpr Rad<Double> operator "" _rad(long double value) { return Rad<Double>(value); }
@ -229,11 +223,9 @@ constexpr Rad<Double> operator "" _rad(long double value) { return Rad<Double>(v
See operator""_degf() for more information. See operator""_degf() for more information.
@see Magnum::operator""_radf(), operator""_rad(), operator""_degf() @see Magnum::operator""_radf(), operator""_rad(), operator""_degf()
@note Not available on GCC < 4.7. Use @ref Rad::Rad(T) instead.
@todoc Make references explicit when Doxygen can link to operator"" @todoc Make references explicit when Doxygen can link to operator""
*/ */
constexpr Rad<Float> operator "" _radf(long double value) { return Rad<Float>(value); } constexpr Rad<Float> operator "" _radf(long double value) { return Rad<Float>(value); }
#endif
template<class T> constexpr Deg<T>::Deg(Unit<Rad, T> value): Unit<Math::Deg, T>(T(180)*T(value)/Math::Constants<T>::pi()) {} template<class T> constexpr Deg<T>::Deg(Unit<Rad, T> value): Unit<Math::Deg, T>(T(180)*T(value)/Math::Constants<T>::pi()) {}
template<class T> constexpr Rad<T>::Rad(Unit<Deg, T> value): Unit<Math::Rad, T>(T(value)*Math::Constants<T>::pi()/T(180)) {} template<class T> constexpr Rad<T>::Rad(Unit<Deg, T> value): Unit<Math::Rad, T>(T(value)*Math::Constants<T>::pi()/T(180)) {}

6
src/Magnum/Math/BoolVector.h

@ -87,13 +87,7 @@ template<std::size_t size> class BoolVector {
#ifdef DOXYGEN_GENERATING_OUTPUT #ifdef DOXYGEN_GENERATING_OUTPUT
inline explicit BoolVector(T value); inline explicit BoolVector(T value);
#else #else
#ifndef CORRADE_GCC46_COMPATIBILITY
template<class T, class U = typename std::enable_if<std::is_same<bool, T>::value && size != 1, bool>::type> constexpr explicit BoolVector(T value): BoolVector(typename Implementation::GenerateSequence<DataSize>::Type(), value ? FullSegmentMask : 0) {} template<class T, class U = typename std::enable_if<std::is_same<bool, T>::value && size != 1, bool>::type> constexpr explicit BoolVector(T value): BoolVector(typename Implementation::GenerateSequence<DataSize>::Type(), value ? FullSegmentMask : 0) {}
#else
template<class T, class U = typename std::enable_if<std::is_same<bool, T>::value && size != 1, bool>::type> explicit BoolVector(T value) {
*this = BoolVector(typename Implementation::GenerateSequence<DataSize>::Type(), value ? FullSegmentMask : 0);
}
#endif
#endif #endif
/** @brief Copy constructor */ /** @brief Copy constructor */

6
src/Magnum/Math/Math.h

@ -46,11 +46,9 @@ template<class> class DualComplex;
template<class> class DualQuaternion; template<class> class DualQuaternion;
template<std::size_t, class> class Matrix; template<std::size_t, class> class Matrix;
#ifndef CORRADE_GCC46_COMPATIBILITY
template<class T> using Matrix2x2 = Matrix<2, T>; template<class T> using Matrix2x2 = Matrix<2, T>;
template<class T> using Matrix3x3 = Matrix<3, T>; template<class T> using Matrix3x3 = Matrix<3, T>;
template<class T> using Matrix4x4 = Matrix<4, T>; template<class T> using Matrix4x4 = Matrix<4, T>;
#endif
template<class> class Matrix3; template<class> class Matrix3;
template<class> class Matrix4; template<class> class Matrix4;
@ -58,14 +56,12 @@ template<class> class Matrix4;
template<class> class Quaternion; template<class> class Quaternion;
template<std::size_t, std::size_t, class> class RectangularMatrix; template<std::size_t, std::size_t, class> class RectangularMatrix;
#ifndef CORRADE_GCC46_COMPATIBILITY
template<class T> using Matrix2x3 = RectangularMatrix<2, 3, T>; template<class T> using Matrix2x3 = RectangularMatrix<2, 3, T>;
template<class T> using Matrix3x2 = RectangularMatrix<3, 2, T>; template<class T> using Matrix3x2 = RectangularMatrix<3, 2, T>;
template<class T> using Matrix2x4 = RectangularMatrix<2, 4, T>; template<class T> using Matrix2x4 = RectangularMatrix<2, 4, T>;
template<class T> using Matrix4x2 = RectangularMatrix<4, 2, T>; template<class T> using Matrix4x2 = RectangularMatrix<4, 2, T>;
template<class T> using Matrix3x4 = RectangularMatrix<3, 4, T>; template<class T> using Matrix3x4 = RectangularMatrix<3, 4, T>;
template<class T> using Matrix4x3 = RectangularMatrix<4, 3, T>; template<class T> using Matrix4x3 = RectangularMatrix<4, 3, T>;
#endif
template<template<class> class, class> class Unit; template<template<class> class, class> class Unit;
template<class> class Deg; template<class> class Deg;
@ -77,9 +73,7 @@ template<class> class Vector3;
template<class> class Vector4; template<class> class Vector4;
template<UnsignedInt, class> class Range; template<UnsignedInt, class> class Range;
#ifndef CORRADE_GCC46_COMPATIBILITY
template<class T> using Range1D = Range<1, T>; template<class T> using Range1D = Range<1, T>;
#endif
template<class> class Range2D; template<class> class Range2D;
template<class> class Range3D; template<class> class Range3D;

14
src/Magnum/Math/Matrix.h

@ -71,14 +71,7 @@ template<std::size_t size, class T> class Matrix: public RectangularMatrix<size,
* `%Matrix m(Matrix::Identity);`. Optional parameter @p value allows * `%Matrix m(Matrix::Identity);`. Optional parameter @p value allows
* you to specify value on diagonal. * you to specify value on diagonal.
*/ */
constexpr /*implicit*/ Matrix(IdentityType = Identity, T value = T(1)): RectangularMatrix<size, size, T>(typename Implementation::GenerateSequence<size>::Type(), constexpr /*implicit*/ Matrix(IdentityType = Identity, T value = T(1)): RectangularMatrix<size, size, T>(typename Implementation::GenerateSequence<size>::Type(), Vector<size, T>(value)) {}
/* The original one is not constexpr under GCC 4.6 */
#ifndef CORRADE_GCC46_COMPATIBILITY
Vector<size, T>(value)
#else
Vector<size, T>(typename Implementation::GenerateSequence<size>::Type(), value)
#endif
) {}
/** /**
* @brief %Matrix from column vectors * @brief %Matrix from column vectors
@ -188,13 +181,11 @@ template<std::size_t size, class T> class Matrix: public RectangularMatrix<size,
#endif #endif
}; };
#ifndef CORRADE_GCC46_COMPATIBILITY
/** /**
@brief 2x2 matrix @brief 2x2 matrix
Convenience alternative to <tt>%Matrix<2, T></tt>. See @ref Matrix for more Convenience alternative to <tt>%Matrix<2, T></tt>. See @ref Matrix for more
information. information.
@note Not available on GCC < 4.7. Use <tt>%Matrix<2, T></tt> instead.
@see @ref Magnum::Matrix2x2, @ref Magnum::Matrix2x2d @see @ref Magnum::Matrix2x2, @ref Magnum::Matrix2x2d
*/ */
template<class T> using Matrix2x2 = Matrix<2, T>; template<class T> using Matrix2x2 = Matrix<2, T>;
@ -205,7 +196,6 @@ template<class T> using Matrix2x2 = Matrix<2, T>;
Convenience alternative to <tt>%Matrix<3, T></tt>. See @ref Matrix for more Convenience alternative to <tt>%Matrix<3, T></tt>. See @ref Matrix for more
information. Note that this is different from @ref Matrix3, which contains information. Note that this is different from @ref Matrix3, which contains
additional functions for transformations in 2D. additional functions for transformations in 2D.
@note Not available on GCC < 4.7. Use <tt>%Matrix<3, T></tt> instead.
@see @ref Magnum::Matrix3x3, @ref Magnum::Matrix3x3d @see @ref Magnum::Matrix3x3, @ref Magnum::Matrix3x3d
*/ */
template<class T> using Matrix3x3 = Matrix<3, T>; template<class T> using Matrix3x3 = Matrix<3, T>;
@ -216,11 +206,9 @@ template<class T> using Matrix3x3 = Matrix<3, T>;
Convenience alternative to <tt>%Matrix<4, T></tt>. See @ref Matrix for more Convenience alternative to <tt>%Matrix<4, T></tt>. See @ref Matrix for more
information. Note that this is different from @ref Matrix4, which contains information. Note that this is different from @ref Matrix4, which contains
additional functions for transformations in 3D. additional functions for transformations in 3D.
@note Not available on GCC < 4.7. Use <tt>%Matrix<3, T></tt> instead.
@see @ref Magnum::Matrix4x4, @ref Magnum::Matrix4x4d @see @ref Magnum::Matrix4x4, @ref Magnum::Matrix4x4d
*/ */
template<class T> using Matrix4x4 = Matrix<4, T>; template<class T> using Matrix4x4 = Matrix<4, T>;
#endif
MAGNUM_MATRIX_OPERATOR_IMPLEMENTATION(Matrix<size, T>) MAGNUM_MATRIX_OPERATOR_IMPLEMENTATION(Matrix<size, T>)

3
src/Magnum/Math/Range.h

@ -185,16 +185,13 @@ template<UnsignedInt dimensions, class T> class Range {
} }
#endif #endif
#ifndef CORRADE_GCC46_COMPATIBILITY
/** /**
@brief One-dimensional range @brief One-dimensional range
Convenience alternative to <tt>%Range<1, T></tt>. See @ref Range for more Convenience alternative to <tt>%Range<1, T></tt>. See @ref Range for more
information. information.
@note Not available on GCC < 4.7. Use <tt>%Range<1, T></tt> instead.
*/ */
template<class T> using Range1D = Range<1, T>; template<class T> using Range1D = Range<1, T>;
#endif
/** /**
@brief Two-dimensional range @brief Two-dimensional range

27
src/Magnum/Math/RectangularMatrix.h

@ -130,22 +130,10 @@ template<std::size_t cols, std::size_t rows, class T> class RectangularMatrix {
* // integral == {1, 2, -15, 7} * // integral == {1, 2, -15, 7}
* @endcode * @endcode
*/ */
#ifndef CORRADE_GCC46_COMPATIBILITY
template<class U> constexpr explicit RectangularMatrix(const RectangularMatrix<cols, rows, U>& other): RectangularMatrix(typename Implementation::GenerateSequence<cols>::Type(), other) {} template<class U> constexpr explicit RectangularMatrix(const RectangularMatrix<cols, rows, U>& other): RectangularMatrix(typename Implementation::GenerateSequence<cols>::Type(), other) {}
#else
template<class U> explicit RectangularMatrix(const RectangularMatrix<cols, rows, U>& other) {
*this = RectangularMatrix(typename Implementation::GenerateSequence<cols>::Type(), other);
}
#endif
/** @brief Construct matrix from external representation */ /** @brief Construct matrix from external representation */
#ifndef CORRADE_GCC46_COMPATIBILITY
template<class U, class V = decltype(Implementation::RectangularMatrixConverter<cols, rows, T, U>::from(std::declval<U>()))> constexpr explicit RectangularMatrix(const U& other): RectangularMatrix(Implementation::RectangularMatrixConverter<cols, rows, T, U>::from(other)) {} template<class U, class V = decltype(Implementation::RectangularMatrixConverter<cols, rows, T, U>::from(std::declval<U>()))> constexpr explicit RectangularMatrix(const U& other): RectangularMatrix(Implementation::RectangularMatrixConverter<cols, rows, T, U>::from(other)) {}
#else
template<class U, class V = decltype(Implementation::RectangularMatrixConverter<cols, rows, T, U>::from(std::declval<U>()))> explicit RectangularMatrix(const U& other) {
*this = Implementation::RectangularMatrixConverter<cols, rows, T, U>::from(other);
}
#endif
/** @brief Copy constructor */ /** @brief Copy constructor */
constexpr RectangularMatrix(const RectangularMatrix<cols, rows, T>&) = default; constexpr RectangularMatrix(const RectangularMatrix<cols, rows, T>&) = default;
@ -155,7 +143,6 @@ template<std::size_t cols, std::size_t rows, class T> class RectangularMatrix {
/** @brief Convert matrix to external representation */ /** @brief Convert matrix to external representation */
template<class U, class V = decltype(Implementation::RectangularMatrixConverter<cols, rows, T, U>::to(std::declval<RectangularMatrix<cols, rows, T>>()))> constexpr explicit operator U() const { template<class U, class V = decltype(Implementation::RectangularMatrixConverter<cols, rows, T, U>::to(std::declval<RectangularMatrix<cols, rows, T>>()))> constexpr explicit operator U() const {
/** @bug Why this is not constexpr under GCC 4.6? */
return Implementation::RectangularMatrixConverter<cols, rows, T, U>::to(*this); return Implementation::RectangularMatrixConverter<cols, rows, T, U>::to(*this);
} }
@ -379,14 +366,11 @@ template<std::size_t cols, std::size_t rows, class T> class RectangularMatrix {
Vector<rows, T> _data[cols]; Vector<rows, T> _data[cols];
}; };
#ifndef CORRADE_GCC46_COMPATIBILITY
/** /**
@brief %Matrix with 2 columns and 3 rows @brief %Matrix with 2 columns and 3 rows
Convenience alternative to <tt>%RectangularMatrix<2, 3, T></tt>. See Convenience alternative to <tt>%RectangularMatrix<2, 3, T></tt>. See
@ref RectangularMatrix for more information. @ref RectangularMatrix for more information.
@note Not available on GCC < 4.7. Use <tt>%RectangularMatrix<2, 3, T></tt>
instead.
@see @ref Magnum::Matrix2x3, @ref Magnum::Matrix2x3d @see @ref Magnum::Matrix2x3, @ref Magnum::Matrix2x3d
*/ */
template<class T> using Matrix2x3 = RectangularMatrix<2, 3, T>; template<class T> using Matrix2x3 = RectangularMatrix<2, 3, T>;
@ -396,8 +380,6 @@ template<class T> using Matrix2x3 = RectangularMatrix<2, 3, T>;
Convenience alternative to <tt>%RectangularMatrix<3, 2, T></tt>. See Convenience alternative to <tt>%RectangularMatrix<3, 2, T></tt>. See
@ref RectangularMatrix for more information. @ref RectangularMatrix for more information.
@note Not available on GCC < 4.7. Use <tt>%RectangularMatrix<3, 2, T></tt>
instead.
@see @ref Magnum::Matrix3x2, @ref Magnum::Matrix3x2d @see @ref Magnum::Matrix3x2, @ref Magnum::Matrix3x2d
*/ */
template<class T> using Matrix3x2 = RectangularMatrix<3, 2, T>; template<class T> using Matrix3x2 = RectangularMatrix<3, 2, T>;
@ -407,8 +389,6 @@ template<class T> using Matrix3x2 = RectangularMatrix<3, 2, T>;
Convenience alternative to <tt>%RectangularMatrix<2, 4, T></tt>. See Convenience alternative to <tt>%RectangularMatrix<2, 4, T></tt>. See
@ref RectangularMatrix for more information. @ref RectangularMatrix for more information.
@note Not available on GCC < 4.7. Use <tt>%RectangularMatrix<2, 4, T></tt>
instead.
@see @ref Magnum::Matrix2x4, @ref Magnum::Matrix2x4d @see @ref Magnum::Matrix2x4, @ref Magnum::Matrix2x4d
*/ */
template<class T> using Matrix2x4 = RectangularMatrix<2, 4, T>; template<class T> using Matrix2x4 = RectangularMatrix<2, 4, T>;
@ -418,8 +398,6 @@ template<class T> using Matrix2x4 = RectangularMatrix<2, 4, T>;
Convenience alternative to <tt>%RectangularMatrix<4, 2, T></tt>. See Convenience alternative to <tt>%RectangularMatrix<4, 2, T></tt>. See
@ref RectangularMatrix for more information. @ref RectangularMatrix for more information.
@note Not available on GCC < 4.7. Use <tt>%RectangularMatrix<4, 2, T></tt>
instead.
@see @ref Magnum::Matrix4x2, @ref Magnum::Matrix4x2d @see @ref Magnum::Matrix4x2, @ref Magnum::Matrix4x2d
*/ */
template<class T> using Matrix4x2 = RectangularMatrix<4, 2, T>; template<class T> using Matrix4x2 = RectangularMatrix<4, 2, T>;
@ -429,8 +407,6 @@ template<class T> using Matrix4x2 = RectangularMatrix<4, 2, T>;
Convenience alternative to <tt>%RectangularMatrix<3, 4, T></tt>. See Convenience alternative to <tt>%RectangularMatrix<3, 4, T></tt>. See
@ref RectangularMatrix for more information. @ref RectangularMatrix for more information.
@note Not available on GCC < 4.7. Use <tt>%RectangularMatrix<3, 4, T></tt>
instead.
@see @ref Magnum::Matrix3x4, @ref Magnum::Matrix3x4d @see @ref Magnum::Matrix3x4, @ref Magnum::Matrix3x4d
*/ */
template<class T> using Matrix3x4 = RectangularMatrix<3, 4, T>; template<class T> using Matrix3x4 = RectangularMatrix<3, 4, T>;
@ -440,12 +416,9 @@ template<class T> using Matrix3x4 = RectangularMatrix<3, 4, T>;
Convenience alternative to <tt>%RectangularMatrix<4, 3, T></tt>. See Convenience alternative to <tt>%RectangularMatrix<4, 3, T></tt>. See
@ref RectangularMatrix for more information. @ref RectangularMatrix for more information.
@note Not available on GCC < 4.7. Use <tt>%RectangularMatrix<4, 3, T></tt>
instead.
@see @ref Magnum::Matrix4x3, @ref Magnum::Matrix4x3d @see @ref Magnum::Matrix4x3, @ref Magnum::Matrix4x3d
*/ */
template<class T> using Matrix4x3 = RectangularMatrix<4, 3, T>; template<class T> using Matrix4x3 = RectangularMatrix<4, 3, T>;
#endif
/** @relates RectangularMatrix /** @relates RectangularMatrix
@brief Multiply number with matrix @brief Multiply number with matrix

4
src/Magnum/Math/Test/AngleTest.cpp

@ -105,7 +105,6 @@ void AngleTest::construct() {
} }
void AngleTest::literals() { void AngleTest::literals() {
#ifndef CORRADE_GCC46_COMPATIBILITY
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
constexpr auto a = 25.0_deg; constexpr auto a = 25.0_deg;
CORRADE_VERIFY((std::is_same<decltype(a), const Degd>::value)); CORRADE_VERIFY((std::is_same<decltype(a), const Degd>::value));
@ -123,9 +122,6 @@ void AngleTest::literals() {
constexpr auto n = 3.14_radf; constexpr auto n = 3.14_radf;
CORRADE_VERIFY((std::is_same<decltype(n), const Rad>::value)); CORRADE_VERIFY((std::is_same<decltype(n), const Rad>::value));
CORRADE_COMPARE(Float(n), 3.14f); CORRADE_COMPARE(Float(n), 3.14f);
#else
CORRADE_SKIP("User-defined literals are not available on GCC < 4.7.");
#endif
} }
void AngleTest::conversion() { void AngleTest::conversion() {

8
src/Magnum/Math/Test/BoolVectorTest.cpp

@ -90,18 +90,10 @@ void BoolVectorTest::constructDefault() {
} }
void BoolVectorTest::constructOneValue() { void BoolVectorTest::constructOneValue() {
#ifndef CORRADE_GCC46_COMPATIBILITY
constexpr BoolVector19 a(false); constexpr BoolVector19 a(false);
#else
BoolVector19 a(false); /* not constexpr under GCC < 4.7 */
#endif
CORRADE_COMPARE(a, BoolVector19(0x00, 0x00, 0x00)); CORRADE_COMPARE(a, BoolVector19(0x00, 0x00, 0x00));
#ifndef CORRADE_GCC46_COMPATIBILITY
constexpr BoolVector19 b(true); constexpr BoolVector19 b(true);
#else
BoolVector19 b(true); /* not constexpr under GCC < 4.7 */
#endif
CORRADE_COMPARE(b, BoolVector19(0xff, 0xff, 0x07)); CORRADE_COMPARE(b, BoolVector19(0xff, 0xff, 0x07));
CORRADE_VERIFY(!(std::is_convertible<bool, BoolVector19>::value)); CORRADE_VERIFY(!(std::is_convertible<bool, BoolVector19>::value));

10
src/Magnum/Math/Test/Matrix3Test.cpp

@ -162,10 +162,7 @@ void Matrix3Test::constructConversion() {
constexpr Matrix3 a({3.0f, 5.0f, 8.0f}, constexpr Matrix3 a({3.0f, 5.0f, 8.0f},
{4.5f, 4.0f, 7.0f}, {4.5f, 4.0f, 7.0f},
{7.9f, -1.0f, 8.0f}); {7.9f, -1.0f, 8.0f});
#ifndef CORRADE_GCC46_COMPATIBILITY constexpr Matrix3i b(a);
constexpr /* Not constexpr under GCC < 4.7 */
#endif
Matrix3i b(a);
CORRADE_COMPARE(b, Matrix3i({3, 5, 8}, CORRADE_COMPARE(b, Matrix3i({3, 5, 8},
{4, 4, 7}, {4, 4, 7},
{7, -1, 8})); {7, -1, 8}));
@ -195,10 +192,7 @@ void Matrix3Test::convert() {
constexpr Matrix3 c(b); constexpr Matrix3 c(b);
CORRADE_COMPARE(c, b); CORRADE_COMPARE(c, b);
#ifndef CORRADE_GCC46_COMPATIBILITY constexpr Mat3 d(b);
constexpr /* Not constexpr under GCC < 4.7 */
#endif
Mat3 d(b);
for(std::size_t i = 0; i != 9; ++i) for(std::size_t i = 0; i != 9; ++i)
CORRADE_COMPARE(d.a[0], a.a[0]); CORRADE_COMPARE(d.a[0], a.a[0]);

10
src/Magnum/Math/Test/Matrix4Test.cpp

@ -181,10 +181,7 @@ void Matrix4Test::constructConversion() {
{4.5f, 4.0f, 7.0f, 2.0f}, {4.5f, 4.0f, 7.0f, 2.0f},
{1.0f, 2.0f, 3.0f, -1.0f}, {1.0f, 2.0f, 3.0f, -1.0f},
{7.9f, -1.0f, 8.0f, -1.5f}); {7.9f, -1.0f, 8.0f, -1.5f});
#ifndef CORRADE_GCC46_COMPATIBILITY constexpr Matrix4i b(a);
constexpr /* Not constexpr under GCC < 4.7 */
#endif
Matrix4i b(a);
CORRADE_COMPARE(b, Matrix4i({3, 5, 8, -3}, CORRADE_COMPARE(b, Matrix4i({3, 5, 8, -3},
{4, 4, 7, 2}, {4, 4, 7, 2},
{1, 2, 3, -1}, {1, 2, 3, -1},
@ -219,10 +216,7 @@ void Matrix4Test::convert() {
constexpr Matrix4 c(b); constexpr Matrix4 c(b);
CORRADE_COMPARE(c, b); CORRADE_COMPARE(c, b);
#ifndef CORRADE_GCC46_COMPATIBILITY constexpr Mat4 d(b);
constexpr /* Not constexpr under GCC < 4.7 */
#endif
Mat4 d(b);
for(std::size_t i = 0; i != 16; ++i) for(std::size_t i = 0; i != 16; ++i)
CORRADE_COMPARE(d.a[i], a.a[i]); CORRADE_COMPARE(d.a[i], a.a[i]);

10
src/Magnum/Math/Test/MatrixTest.cpp

@ -159,10 +159,7 @@ void MatrixTest::constructConversion() {
Vector4(4.5f, 4.0f, 7.0f, 2.0f), Vector4(4.5f, 4.0f, 7.0f, 2.0f),
Vector4(1.0f, 2.0f, 3.0f, -1.0f), Vector4(1.0f, 2.0f, 3.0f, -1.0f),
Vector4(7.9f, -1.0f, 8.0f, -1.5f)); Vector4(7.9f, -1.0f, 8.0f, -1.5f));
#ifndef CORRADE_GCC46_COMPATIBILITY constexpr Matrix4x4i b(a);
constexpr /* Not constexpr under GCC < 4.7 */
#endif
Matrix4x4i b(a);
CORRADE_COMPARE(b, Matrix4x4i(Vector4i(3, 5, 8, -3), CORRADE_COMPARE(b, Matrix4x4i(Vector4i(3, 5, 8, -3),
Vector4i(4, 4, 7, 2), Vector4i(4, 4, 7, 2),
Vector4i(1, 2, 3, -1), Vector4i(1, 2, 3, -1),
@ -195,10 +192,7 @@ void MatrixTest::convert() {
constexpr Matrix3x3 c(b); constexpr Matrix3x3 c(b);
CORRADE_COMPARE(c, b); CORRADE_COMPARE(c, b);
#ifndef CORRADE_GCC46_COMPATIBILITY constexpr Mat3 d(b);
constexpr /* Not constexpr under GCC < 4.7 */
#endif
Mat3 d(b);
for(std::size_t i = 0; i != 9; ++i) for(std::size_t i = 0; i != 9; ++i)
CORRADE_COMPARE(d.a[i], a.a[i]); CORRADE_COMPARE(d.a[i], a.a[i]);

23
src/Magnum/Math/Test/RangeTest.cpp

@ -65,18 +65,10 @@ class RangeTest: public Corrade::TestSuite::Tester {
void configuration(); void configuration();
}; };
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef Math::Range1D<Float> Range1D; typedef Math::Range1D<Float> Range1D;
#else
typedef Math::Range<1, Float> Range1D;
#endif
typedef Math::Range2D<Float> Range2D; typedef Math::Range2D<Float> Range2D;
typedef Math::Range3D<Float> Range3D; typedef Math::Range3D<Float> Range3D;
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef Math::Range1D<Int> Range1Di; typedef Math::Range1D<Int> Range1Di;
#else
typedef Math::Range<1, Int> Range1Di;
#endif
typedef Math::Range2D<Int> Range2Di; typedef Math::Range2D<Int> Range2Di;
typedef Math::Range3D<Int> Range3Di; typedef Math::Range3D<Int> Range3Di;
typedef Vector2<Int> Vector2i; typedef Vector2<Int> Vector2i;
@ -140,22 +132,13 @@ void RangeTest::constructConversion() {
constexpr Range2D b({1.3f, 2.7f}, {-15.0f, 7.0f}); constexpr Range2D b({1.3f, 2.7f}, {-15.0f, 7.0f});
constexpr Range3D c({1.3f, 2.7f, -1.5f}, {-15.0f, 7.0f, 0.3f}); constexpr Range3D c({1.3f, 2.7f, -1.5f}, {-15.0f, 7.0f, 0.3f});
#ifndef CORRADE_GCC46_COMPATIBILITY constexpr Range1Di d(a);
constexpr /* Not constexpr under GCC < 4.7 */
#endif
Range1Di d(a);
CORRADE_COMPARE(d, Range1Di(1, -15)); CORRADE_COMPARE(d, Range1Di(1, -15));
#ifndef CORRADE_GCC46_COMPATIBILITY constexpr Range2Di e(b);
constexpr /* Not constexpr under GCC < 4.7 */
#endif
Range2Di e(b);
CORRADE_COMPARE(e, Range2Di({1, 2}, {-15, 7})); CORRADE_COMPARE(e, Range2Di({1, 2}, {-15, 7}));
#ifndef CORRADE_GCC46_COMPATIBILITY constexpr Range3Di f(c);
constexpr /* Not constexpr under GCC < 4.7 */
#endif
Range3Di f(c);
CORRADE_COMPARE(f, Range3Di({1, 2, -1}, {-15, 7, 0})); CORRADE_COMPARE(f, Range3Di({1, 2, -1}, {-15, 7, 0}));
/* Implicit conversion is not allowed */ /* Implicit conversion is not allowed */

15
src/Magnum/Math/Test/RectangularMatrixTest.cpp

@ -155,10 +155,7 @@ void RectangularMatrixTest::constructDefault() {
void RectangularMatrixTest::constructConversion() { void RectangularMatrixTest::constructConversion() {
constexpr Matrix2x2 a(Vector2( 1.3f, 2.7f), constexpr Matrix2x2 a(Vector2( 1.3f, 2.7f),
Vector2(-15.0f, 7.0f)); Vector2(-15.0f, 7.0f));
#ifndef CORRADE_GCC46_COMPATIBILITY constexpr Matrix2x2i b(a);
constexpr /* Not constexpr under GCC < 4.7 */
#endif
Matrix2x2i b(a);
CORRADE_COMPARE(b, Matrix2x2i(Vector2i( 1, 2), CORRADE_COMPARE(b, Matrix2x2i(Vector2i( 1, 2),
Vector2i(-15, 7))); Vector2i(-15, 7)));
@ -215,16 +212,10 @@ void RectangularMatrixTest::convert() {
constexpr Matrix2x3 b(Vector3(1.5f, 2.0f, -3.5f), constexpr Matrix2x3 b(Vector3(1.5f, 2.0f, -3.5f),
Vector3(2.0f, -3.1f, 0.4f)); Vector3(2.0f, -3.1f, 0.4f));
#ifndef CORRADE_GCC46_COMPATIBILITY constexpr Matrix2x3 c(b);
constexpr /* Not constexpr under GCC < 4.7 */
#endif
Matrix2x3 c(b);
CORRADE_COMPARE(c, b); CORRADE_COMPARE(c, b);
#ifndef CORRADE_GCC46_COMPATIBILITY constexpr Mat2x3 d(b);
constexpr /* Not constexpr under GCC < 4.7 */
#endif
Mat2x3 d(b);
for(std::size_t i = 0; i != 5; ++i) for(std::size_t i = 0; i != 5; ++i)
CORRADE_COMPARE(d.a[i], a.a[i]); CORRADE_COMPARE(d.a[i], a.a[i]);

15
src/Magnum/Math/Test/Vector2Test.cpp

@ -113,10 +113,7 @@ void Vector2Test::constructDefault() {
} }
void Vector2Test::constructOneValue() { void Vector2Test::constructOneValue() {
#ifndef CORRADE_GCC46_COMPATIBILITY constexpr Vector2 a(3.0f);
constexpr /* Not constexpr under GCC < 4.7 */
#endif
Vector2 a(3.0f);
CORRADE_COMPARE(a, Vector2(3.0f, 3.0f)); CORRADE_COMPARE(a, Vector2(3.0f, 3.0f));
/* Implicit conversion is not allowed */ /* Implicit conversion is not allowed */
@ -125,10 +122,7 @@ void Vector2Test::constructOneValue() {
void Vector2Test::constructConversion() { void Vector2Test::constructConversion() {
constexpr Vector2 a(1.5f, 2.5f); constexpr Vector2 a(1.5f, 2.5f);
#ifndef CORRADE_GCC46_COMPATIBILITY constexpr Vector2i b(a);
constexpr /* Not constexpr under GCC < 4.7 */
#endif
Vector2i b(a);
CORRADE_COMPARE(b, Vector2i(1, 2)); CORRADE_COMPARE(b, Vector2i(1, 2));
/* Implicit conversion is not allowed */ /* Implicit conversion is not allowed */
@ -148,10 +142,7 @@ void Vector2Test::convert() {
constexpr Vector2 c(a); constexpr Vector2 c(a);
CORRADE_COMPARE(c, b); CORRADE_COMPARE(c, b);
#ifndef CORRADE_GCC46_COMPATIBILITY constexpr Vec2 d(b);
constexpr /* Not constexpr under GCC < 4.7 */
#endif
Vec2 d(b);
CORRADE_COMPARE(d.x, a.x); CORRADE_COMPARE(d.x, a.x);
CORRADE_COMPARE(d.y, a.y); CORRADE_COMPARE(d.y, a.y);

15
src/Magnum/Math/Test/Vector3Test.cpp

@ -111,10 +111,7 @@ void Vector3Test::constructDefault() {
} }
void Vector3Test::constructOneValue() { void Vector3Test::constructOneValue() {
#ifndef CORRADE_GCC46_COMPATIBILITY constexpr Vector3 a(-3.0f);
constexpr /* Not constexpr under GCC < 4.7 */
#endif
Vector3 a(-3.0f);
CORRADE_COMPARE(a, Vector3(-3.0f, -3.0f, -3.0f)); CORRADE_COMPARE(a, Vector3(-3.0f, -3.0f, -3.0f));
/* Implicit conversion is not allowed */ /* Implicit conversion is not allowed */
@ -129,10 +126,7 @@ void Vector3Test::constructParts() {
void Vector3Test::constructConversion() { void Vector3Test::constructConversion() {
constexpr Vector3 a(1.0f, 2.5f, -3.0f); constexpr Vector3 a(1.0f, 2.5f, -3.0f);
#ifndef CORRADE_GCC46_COMPATIBILITY constexpr Vector3i b(a);
constexpr /* Not constexpr under GCC < 4.7 */
#endif
Vector3i b(a);
CORRADE_COMPARE(b, Vector3i(1, 2, -3)); CORRADE_COMPARE(b, Vector3i(1, 2, -3));
/* Implicit conversion is not allowed */ /* Implicit conversion is not allowed */
@ -152,10 +146,7 @@ void Vector3Test::convert() {
constexpr Vector3 c(a); constexpr Vector3 c(a);
CORRADE_COMPARE(c, b); CORRADE_COMPARE(c, b);
#ifndef CORRADE_GCC46_COMPATIBILITY constexpr Vec3 d(b);
constexpr /* Not constexpr under GCC < 4.7 */
#endif
Vec3 d(b);
CORRADE_COMPARE(d.x, a.x); CORRADE_COMPARE(d.x, a.x);
CORRADE_COMPARE(d.y, a.y); CORRADE_COMPARE(d.y, a.y);
CORRADE_COMPARE(d.z, a.z); CORRADE_COMPARE(d.z, a.z);

15
src/Magnum/Math/Test/Vector4Test.cpp

@ -108,10 +108,7 @@ void Vector4Test::constructDefault() {
} }
void Vector4Test::constructOneValue() { void Vector4Test::constructOneValue() {
#ifndef CORRADE_GCC46_COMPATIBILITY constexpr Vector4 a(4.3f);
constexpr /* Not constexpr under GCC < 4.7 */
#endif
Vector4 a(4.3f);
CORRADE_COMPARE(a, Vector4(4.3f, 4.3f, 4.3f, 4.3f)); CORRADE_COMPARE(a, Vector4(4.3f, 4.3f, 4.3f, 4.3f));
/* Implicit conversion is not allowed */ /* Implicit conversion is not allowed */
@ -126,10 +123,7 @@ void Vector4Test::constructParts() {
void Vector4Test::constructConversion() { void Vector4Test::constructConversion() {
constexpr Vector4 a(1.0f, -2.5f, 3.0f, 4.1f); constexpr Vector4 a(1.0f, -2.5f, 3.0f, 4.1f);
#ifndef CORRADE_GCC46_COMPATIBILITY constexpr Vector4i b(a);
constexpr /* Not constexpr under GCC < 4.7 */
#endif
Vector4i b(a);
CORRADE_COMPARE(b, Vector4i(1, -2, 3, 4)); CORRADE_COMPARE(b, Vector4i(1, -2, 3, 4));
/* Implicit conversion is not allowed */ /* Implicit conversion is not allowed */
@ -149,10 +143,7 @@ void Vector4Test::convert() {
constexpr Vector4 c(a); constexpr Vector4 c(a);
CORRADE_COMPARE(c, b); CORRADE_COMPARE(c, b);
#ifndef CORRADE_GCC46_COMPATIBILITY constexpr Vec4 d(b);
constexpr /* Not constexpr under GCC < 4.7 */
#endif
Vec4 d(b);
CORRADE_COMPARE(d.x, a.x); CORRADE_COMPARE(d.x, a.x);
CORRADE_COMPARE(d.y, a.y); CORRADE_COMPARE(d.y, a.y);
CORRADE_COMPARE(d.z, a.z); CORRADE_COMPARE(d.z, a.z);

20
src/Magnum/Math/Test/VectorTest.cpp

@ -175,10 +175,7 @@ void VectorTest::constructDefault() {
} }
void VectorTest::constructOneValue() { void VectorTest::constructOneValue() {
#ifndef CORRADE_GCC46_COMPATIBILITY constexpr Vector4 a(7.25f);
constexpr /* Not constexpr under GCC < 4.7 */
#endif
Vector4 a(7.25f);
CORRADE_COMPARE(a, Vector4(7.25f, 7.25f, 7.25f, 7.25f)); CORRADE_COMPARE(a, Vector4(7.25f, 7.25f, 7.25f, 7.25f));
@ -196,10 +193,7 @@ void VectorTest::constructOneComponent() {
void VectorTest::constructConversion() { void VectorTest::constructConversion() {
constexpr Vector4 a(1.3f, 2.7f, -15.0f, 7.0f); constexpr Vector4 a(1.3f, 2.7f, -15.0f, 7.0f);
#ifndef CORRADE_GCC46_COMPATIBILITY constexpr Vector4i b(a);
constexpr /* Not constexpr under GCC < 4.7 */
#endif
Vector4i b(a);
CORRADE_COMPARE(b, Vector4i(1, 2, -15, 7)); CORRADE_COMPARE(b, Vector4i(1, 2, -15, 7));
@ -227,16 +221,10 @@ void VectorTest::convert() {
constexpr Vec3 a{1.5f, 2.0f, -3.5f}; constexpr Vec3 a{1.5f, 2.0f, -3.5f};
constexpr Vector3 b(1.5f, 2.0f, -3.5f); constexpr Vector3 b(1.5f, 2.0f, -3.5f);
#ifndef CORRADE_GCC46_COMPATIBILITY constexpr Vector3 c(b);
constexpr /* Not constexpr under GCC < 4.7 */
#endif
Vector3 c(b);
CORRADE_COMPARE(c, b); CORRADE_COMPARE(c, b);
#ifndef CORRADE_GCC46_COMPATIBILITY constexpr Vec3 d(b);
constexpr /* Not constexpr under GCC < 4.7 */
#endif
Vec3 d(b);
CORRADE_COMPARE(d.x, a.x); CORRADE_COMPARE(d.x, a.x);
CORRADE_COMPARE(d.y, a.y); CORRADE_COMPARE(d.y, a.y);
CORRADE_COMPARE(d.z, a.z); CORRADE_COMPARE(d.z, a.z);

24
src/Magnum/Math/Vector.h

@ -59,11 +59,6 @@ template<std::size_t size, class T> class Vector {
template<std::size_t, class> friend class Vector; template<std::size_t, class> friend class Vector;
#ifdef CORRADE_GCC46_COMPATIBILITY
/* So it can call internal constexpr constructor from one value */
template<std::size_t, class> friend class Matrix;
#endif
public: public:
typedef T Type; /**< @brief Underlying data type */ typedef T Type; /**< @brief Underlying data type */
const static std::size_t Size = size; /**< @brief %Vector size */ const static std::size_t Size = size; /**< @brief %Vector size */
@ -137,13 +132,7 @@ template<std::size_t size, class T> class Vector {
#ifdef DOXYGEN_GENERATING_OUTPUT #ifdef DOXYGEN_GENERATING_OUTPUT
constexpr explicit Vector(T value); constexpr explicit Vector(T value);
#else #else
#ifndef CORRADE_GCC46_COMPATIBILITY
template<class U, class V = typename std::enable_if<std::is_same<T, U>::value && size != 1, T>::type> constexpr explicit Vector(U value): Vector(typename Implementation::GenerateSequence<size>::Type(), value) {} template<class U, class V = typename std::enable_if<std::is_same<T, U>::value && size != 1, T>::type> constexpr explicit Vector(U value): Vector(typename Implementation::GenerateSequence<size>::Type(), value) {}
#else
template<class U, class V = typename std::enable_if<std::is_same<T, U>::value && size != 1, T>::type> explicit Vector(U value) {
*this = Vector(typename Implementation::GenerateSequence<size>::Type(), value);
}
#endif
#endif #endif
/** /**
@ -157,22 +146,10 @@ template<std::size_t size, class T> class Vector {
* // integral == {1, 2, -15, 7} * // integral == {1, 2, -15, 7}
* @endcode * @endcode
*/ */
#ifndef CORRADE_GCC46_COMPATIBILITY
template<class U> constexpr explicit Vector(const Vector<size, U>& other): Vector(typename Implementation::GenerateSequence<size>::Type(), other) {} template<class U> constexpr explicit Vector(const Vector<size, U>& other): Vector(typename Implementation::GenerateSequence<size>::Type(), other) {}
#else
template<class U> explicit Vector(const Vector<size, U>& other) {
*this = Vector(typename Implementation::GenerateSequence<size>::Type(), other);
}
#endif
/** @brief Construct vector from external representation */ /** @brief Construct vector from external representation */
#ifndef CORRADE_GCC46_COMPATIBILITY
template<class U, class V = decltype(Implementation::VectorConverter<size, T, U>::from(std::declval<U>()))> constexpr explicit Vector(const U& other): Vector(Implementation::VectorConverter<size, T, U>::from(other)) {} template<class U, class V = decltype(Implementation::VectorConverter<size, T, U>::from(std::declval<U>()))> constexpr explicit Vector(const U& other): Vector(Implementation::VectorConverter<size, T, U>::from(other)) {}
#else
template<class U, class V = decltype(Implementation::VectorConverter<size, T, U>::from(std::declval<U>()))> explicit Vector(const U& other) {
*this = Implementation::VectorConverter<size, T, U>::from(other);
}
#endif
/** @brief Copy constructor */ /** @brief Copy constructor */
constexpr Vector(const Vector<size, T>&) = default; constexpr Vector(const Vector<size, T>&) = default;
@ -182,7 +159,6 @@ template<std::size_t size, class T> class Vector {
/** @brief Convert vector to external representation */ /** @brief Convert vector to external representation */
template<class U, class V = decltype(Implementation::VectorConverter<size, T, U>::to(std::declval<Vector<size, T>>()))> constexpr explicit operator U() const { template<class U, class V = decltype(Implementation::VectorConverter<size, T, U>::to(std::declval<Vector<size, T>>()))> constexpr explicit operator U() const {
/** @bug Why this is not constexpr under GCC 4.6? */
return Implementation::VectorConverter<size, T, U>::to(*this); return Implementation::VectorConverter<size, T, U>::to(*this);
} }

4
src/Magnum/MeshTools/CombineIndexedArrays.cpp

@ -136,11 +136,7 @@ std::pair<std::vector<UnsignedInt>, std::vector<UnsignedInt>> combineIndexArrays
std::vector<UnsignedInt> newInterleavedArrays; std::vector<UnsignedInt> newInterleavedArrays;
for(std::size_t oldIndex = 0, end = interleavedArrays.size()/stride; oldIndex != end; ++oldIndex) { for(std::size_t oldIndex = 0, end = interleavedArrays.size()/stride; oldIndex != end; ++oldIndex) {
/* Try to insert new index combination to the map */ /* Try to insert new index combination to the map */
#ifndef CORRADE_GCC46_COMPATIBILITY
const auto result = indexCombinations.emplace(oldIndex, indexCombinations.size()); const auto result = indexCombinations.emplace(oldIndex, indexCombinations.size());
#else
const auto result = indexCombinations.insert({oldIndex, indexCombinations.size()});
#endif
/* Add the (either new or already existing) index to resulting index array */ /* Add the (either new or already existing) index to resulting index array */
combinedIndices.push_back(result.first->second); combinedIndices.push_back(result.first->second);

4
src/Magnum/MeshTools/RemoveDuplicates.h

@ -131,11 +131,7 @@ template<class Vector> std::vector<UnsignedInt> removeDuplicates(std::vector<Vec
for(std::size_t i = 0; i != data.size(); ++i) { for(std::size_t i = 0; i != data.size(); ++i) {
/* Try to insert new vertex to the table */ /* Try to insert new vertex to the table */
const Math::Vector<Vector::Size, std::size_t> v((data[i] + moved - min)/epsilon); const Math::Vector<Vector::Size, std::size_t> v((data[i] + moved - min)/epsilon);
#ifndef CORRADE_GCC46_COMPATIBILITY
const auto result = table.emplace(v, table.size()); const auto result = table.emplace(v, table.size());
#else
const auto result = table.insert({v, table.size()});
#endif
/* Add the (either new or already existing) index to index array */ /* Add the (either new or already existing) index to index array */
indices.push_back(result.first->second); indices.push_back(result.first->second);

9
src/Magnum/MeshTools/Test/TransformTest.cpp

@ -51,11 +51,6 @@ TransformTest::TransformTest() {
&TransformTest::transformPoints3D}); &TransformTest::transformPoints3D});
} }
/* GCC < 4.7 doesn't like constexpr here, don't know why */
#ifdef CORRADE_GCC46_COMPATIBILITY
#define constexpr const
#endif
constexpr static std::array<Vector2, 2> points2D{{ constexpr static std::array<Vector2, 2> points2D{{
{-3.0f, 4.0f}, {-3.0f, 4.0f},
{ 2.5f, -15.0f} { 2.5f, -15.0f}
@ -86,10 +81,6 @@ constexpr static std::array<Vector3, 2> points3DRotatedTranslated{{
{15.0f, 1.5f, 1.5f} {15.0f, 1.5f, 1.5f}
}}; }};
#ifdef CORRADE_GCC46_COMPATIBILITY
#undef constexpr
#endif
void TransformTest::transformVectors2D() { void TransformTest::transformVectors2D() {
auto matrix = MeshTools::transformVectors(Matrix3::rotation(Deg(90.0f)), points2D); auto matrix = MeshTools::transformVectors(Matrix3::rotation(Deg(90.0f)), points2D);
auto complex = MeshTools::transformVectors(Complex::rotation(Deg(90.0f)), points2D); auto complex = MeshTools::transformVectors(Complex::rotation(Deg(90.0f)), points2D);

2
src/Magnum/Platform/Implementation/EglContextHandler.h

@ -33,8 +33,6 @@
#undef None #undef None
#undef Complex #undef Complex
#include <Corrade/compatibility.h>
#include "Magnum/Magnum.h" #include "Magnum/Magnum.h"
#include "Magnum/Platform/AbstractXApplication.h" #include "Magnum/Platform/AbstractXApplication.h"
#include "Magnum/Platform/Implementation/AbstractContextHandler.h" #include "Magnum/Platform/Implementation/AbstractContextHandler.h"

2
src/Magnum/Platform/Implementation/GlxContextHandler.h

@ -35,8 +35,6 @@
#undef None #undef None
#undef Status #undef Status
#include <Corrade/compatibility.h>
#include "Magnum/Platform/AbstractXApplication.h" #include "Magnum/Platform/AbstractXApplication.h"
#include "Magnum/Platform/Implementation/AbstractContextHandler.h" #include "Magnum/Platform/Implementation/AbstractContextHandler.h"

1
src/Magnum/Platform/NaClApplication.h

@ -30,7 +30,6 @@
*/ */
#include <string> #include <string>
#include <Corrade/compatibility.h>
#include <Corrade/Containers/EnumSet.h> #include <Corrade/Containers/EnumSet.h>
#include <ppapi/cpp/input_event.h> #include <ppapi/cpp/input_event.h>
#include <ppapi/cpp/instance.h> #include <ppapi/cpp/instance.h>

1
src/Magnum/Platform/WindowlessNaClApplication.h

@ -30,7 +30,6 @@
*/ */
#include <string> #include <string>
#include <Corrade/compatibility.h>
#include <Corrade/Containers/EnumSet.h> #include <Corrade/Containers/EnumSet.h>
#include <ppapi/cpp/instance.h> #include <ppapi/cpp/instance.h>
#include <ppapi/cpp/module.h> #include <ppapi/cpp/module.h>

4
src/Magnum/Platform/magnum-info.cpp

@ -25,7 +25,6 @@
#include <Corrade/Utility/Arguments.h> #include <Corrade/Utility/Arguments.h>
#include <Corrade/Utility/Debug.h> #include <Corrade/Utility/Debug.h>
#include <Corrade/compatibility.h>
#ifdef CORRADE_TARGET_NACL #ifdef CORRADE_TARGET_NACL
#include <Corrade/Utility/NaClStreamBuffer.h> #include <Corrade/Utility/NaClStreamBuffer.h>
#endif #endif
@ -105,9 +104,6 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat
Debug() << "Used application: Platform::WindowlessGlxApplication"; Debug() << "Used application: Platform::WindowlessGlxApplication";
#endif #endif
Debug() << "Compilation flags:"; Debug() << "Compilation flags:";
#ifdef CORRADE_GCC46_COMPATIBILITY
Debug() << " CORRADE_GCC46_COMPATIBILITY";
#endif
#ifdef CORRADE_GCC47_COMPATIBILITY #ifdef CORRADE_GCC47_COMPATIBILITY
Debug() << " CORRADE_GCC47_COMPATIBILITY"; Debug() << " CORRADE_GCC47_COMPATIBILITY";
#endif #endif

4
src/Magnum/ResourceManager.h

@ -528,11 +528,7 @@ template<class T> void ResourceManagerData<T>::set(const ResourceKey key, T* con
/* Insert it, if not already here */ /* Insert it, if not already here */
} else if(it == _data.end()) } else if(it == _data.end())
#ifndef CORRADE_GCC46_COMPATIBILITY
it = _data.emplace(key, Data()).first; it = _data.emplace(key, Data()).first;
#else
it = _data.insert({key, Data()}).first;
#endif
/* Replace previous data */ /* Replace previous data */
safeDelete(it->second.data); safeDelete(it->second.data);

14
src/Magnum/SceneGraph/AbstractCamera.h

@ -163,51 +163,37 @@ template<UnsignedInt dimensions, class T> class AbstractCamera: public AbstractF
Vector2i _viewport; Vector2i _viewport;
}; };
#ifndef CORRADE_GCC46_COMPATIBILITY
/** /**
@brief Base camera for two-dimensional scenes @brief Base camera for two-dimensional scenes
Convenience alternative to <tt>%AbstractCamera<2, T></tt>. See Convenience alternative to <tt>%AbstractCamera<2, T></tt>. See
@ref AbstractCamera for more information. @ref AbstractCamera for more information.
@note Not available on GCC < 4.7. Use <tt>%AbstractCamera<2, T></tt> instead.
@see @ref AbstractCamera2D, @ref AbstractBasicCamera3D @see @ref AbstractCamera2D, @ref AbstractBasicCamera3D
*/ */
template<class T> using AbstractBasicCamera2D = AbstractCamera<2, T>; template<class T> using AbstractBasicCamera2D = AbstractCamera<2, T>;
#endif
/** /**
@brief Base camera for two-dimensional float scenes @brief Base camera for two-dimensional float scenes
@see @ref AbstractCamera3D @see @ref AbstractCamera3D
*/ */
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef AbstractBasicCamera2D<Float> AbstractCamera2D; typedef AbstractBasicCamera2D<Float> AbstractCamera2D;
#else
typedef AbstractCamera<2, Float> AbstractCamera2D;
#endif
#ifndef CORRADE_GCC46_COMPATIBILITY
/** /**
@brief Base camera for three-dimensional scenes @brief Base camera for three-dimensional scenes
Convenience alternative to <tt>%AbstractCamera<3, T></tt>. See Convenience alternative to <tt>%AbstractCamera<3, T></tt>. See
@ref AbstractCamera for more information. @ref AbstractCamera for more information.
@note Not available on GCC < 4.7. Use <tt>%AbstractCamera<3, T></tt> instead.
@see @ref AbstractCamera3D, @ref AbstractBasicCamera2D @see @ref AbstractCamera3D, @ref AbstractBasicCamera2D
*/ */
template<class T> using AbstractBasicCamera3D = AbstractCamera<3, T>; template<class T> using AbstractBasicCamera3D = AbstractCamera<3, T>;
#endif
/** /**
@brief Base camera for three-dimensional float scenes @brief Base camera for three-dimensional float scenes
@see @ref AbstractCamera2D @see @ref AbstractCamera2D
*/ */
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef AbstractBasicCamera3D<Float> AbstractCamera3D; typedef AbstractBasicCamera3D<Float> AbstractCamera3D;
#else
typedef AbstractCamera<3, Float> AbstractCamera3D;
#endif
#ifdef CORRADE_TARGET_WINDOWS #ifdef CORRADE_TARGET_WINDOWS
extern template class MAGNUM_SCENEGRAPH_EXPORT AbstractCamera<2, Float>; extern template class MAGNUM_SCENEGRAPH_EXPORT AbstractCamera<2, Float>;

23
src/Magnum/SceneGraph/AbstractFeature.h

@ -183,14 +183,7 @@ template<UnsignedInt dimensions, class T> class AbstractFeature
/* This is here to avoid ambiguity with deleted copy constructor when /* This is here to avoid ambiguity with deleted copy constructor when
passing `*this` from class subclassing both AbstractFeature and passing `*this` from class subclassing both AbstractFeature and
AbstractObject */ AbstractObject */
template<class U, class = typename std::enable_if<std::is_base_of<AbstractObject<dimensions, T>, U>::value>::type> AbstractFeature(U& object) template<class U, class = typename std::enable_if<std::is_base_of<AbstractObject<dimensions, T>, U>::value>::type> AbstractFeature(U& object): AbstractFeature(static_cast<AbstractObject<dimensions, T>&>(object)) {}
#ifndef CORRADE_GCC46_COMPATIBILITY
: AbstractFeature(static_cast<AbstractObject<dimensions, T>&>(object)) {}
#else
{
object.Containers::template LinkedList<AbstractFeature<dimensions, T>>::insert(this);
}
#endif
#endif #endif
virtual ~AbstractFeature() = 0; virtual ~AbstractFeature() = 0;
@ -298,51 +291,37 @@ template<UnsignedInt dimensions, class T> class AbstractFeature
CachedTransformations _cachedTransformations; CachedTransformations _cachedTransformations;
}; };
#ifndef CORRADE_GCC46_COMPATIBILITY
/** /**
@brief Base feature for two-dimensional scenes @brief Base feature for two-dimensional scenes
Convenience alternative to <tt>%AbstractFeature<2, T></tt>. See Convenience alternative to <tt>%AbstractFeature<2, T></tt>. See
@ref AbstractFeature for more information. @ref AbstractFeature for more information.
@note Not available on GCC < 4.7. Use <tt>%AbstractFeature<2, T></tt> instead.
@see @ref AbstractFeature2D, @ref AbstractBasicFeature3D @see @ref AbstractFeature2D, @ref AbstractBasicFeature3D
*/ */
template<class T> using AbstractBasicFeature2D = AbstractFeature<2, T>; template<class T> using AbstractBasicFeature2D = AbstractFeature<2, T>;
#endif
/** /**
@brief Base feature for two-dimensional float scenes @brief Base feature for two-dimensional float scenes
@see @ref AbstractFeature3D @see @ref AbstractFeature3D
*/ */
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef AbstractBasicFeature2D<Float> AbstractFeature2D; typedef AbstractBasicFeature2D<Float> AbstractFeature2D;
#else
typedef AbstractFeature<2, Float> AbstractFeature2D;
#endif
#ifndef CORRADE_GCC46_COMPATIBILITY
/** /**
@brief Base feature for three-dimensional scenes @brief Base feature for three-dimensional scenes
Convenience alternative to <tt>%AbstractFeature<3, T></tt>. See Convenience alternative to <tt>%AbstractFeature<3, T></tt>. See
@ref AbstractFeature for more information. @ref AbstractFeature for more information.
@note Not available on GCC < 4.7. Use <tt>%AbstractFeature<3, T></tt> instead.
@see @ref AbstractFeature3D, @ref AbstractBasicFeature2D @see @ref AbstractFeature3D, @ref AbstractBasicFeature2D
*/ */
template<class T> using AbstractBasicFeature3D = AbstractFeature<3, T>; template<class T> using AbstractBasicFeature3D = AbstractFeature<3, T>;
#endif
/** /**
@brief Base feature for three-dimensional float scenes @brief Base feature for three-dimensional float scenes
@see @ref AbstractFeature2D @see @ref AbstractFeature2D
*/ */
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef AbstractBasicFeature3D<Float> AbstractFeature3D; typedef AbstractBasicFeature3D<Float> AbstractFeature3D;
#else
typedef AbstractFeature<3, Float> AbstractFeature3D;
#endif
#ifdef CORRADE_TARGET_WINDOWS #ifdef CORRADE_TARGET_WINDOWS
extern template class MAGNUM_SCENEGRAPH_EXPORT AbstractFeature<2, Float>; extern template class MAGNUM_SCENEGRAPH_EXPORT AbstractFeature<2, Float>;

10
src/Magnum/SceneGraph/AbstractGroupedFeature.h

@ -107,14 +107,11 @@ template<UnsignedInt dimensions, class Derived, class T> class AbstractGroupedFe
FeatureGroup<dimensions, Derived, T>* _group; FeatureGroup<dimensions, Derived, T>* _group;
}; };
#ifndef CORRADE_GCC46_COMPATIBILITY
/** /**
@brief Base grouped feature for two-dimensional scenes @brief Base grouped feature for two-dimensional scenes
Convenience alternative to <tt>%AbstractGroupedFeature<2, Derived, T></tt>. See Convenience alternative to <tt>%AbstractGroupedFeature<2, Derived, T></tt>. See
@ref AbstractGroupedFeature for more information. @ref AbstractGroupedFeature for more information.
@note Not available on GCC < 4.7. Use <tt>%AbstractGroupedFeature<2, Derived, T></tt>
instead.
@see @ref AbstractGroupedFeature2D, @ref AbstractBasicGroupedFeature3D @see @ref AbstractGroupedFeature2D, @ref AbstractBasicGroupedFeature3D
*/ */
template<class Derived, class T> using AbstractBasicGroupedFeature2D = AbstractGroupedFeature<2, Derived, T>; template<class Derived, class T> using AbstractBasicGroupedFeature2D = AbstractGroupedFeature<2, Derived, T>;
@ -124,8 +121,6 @@ template<class Derived, class T> using AbstractBasicGroupedFeature2D = AbstractG
Convenience alternative to <tt>%AbstractBasicGroupedFeature2D<Derived, Float></tt>. Convenience alternative to <tt>%AbstractBasicGroupedFeature2D<Derived, Float></tt>.
See @ref AbstractGroupedFeature for more information. See @ref AbstractGroupedFeature for more information.
@note Not available on GCC < 4.7. Use <tt>%AbstractGroupedFeature<2, Derived, Float></tt>
instead.
@see @ref AbstractGroupedFeature3D @see @ref AbstractGroupedFeature3D
*/ */
template<class Derived> using AbstractGroupedFeature2D = AbstractBasicGroupedFeature2D<Derived, Float>; template<class Derived> using AbstractGroupedFeature2D = AbstractBasicGroupedFeature2D<Derived, Float>;
@ -135,8 +130,6 @@ template<class Derived> using AbstractGroupedFeature2D = AbstractBasicGroupedFea
Convenience alternative to <tt>%AbstractGroupedFeature<3, Derived, T></tt>. See Convenience alternative to <tt>%AbstractGroupedFeature<3, Derived, T></tt>. See
@ref AbstractGroupedFeature for more information. @ref AbstractGroupedFeature for more information.
@note Not available on GCC < 4.7. Use <tt>%AbstractGroupedFeature<3, Derived, T></tt>
instead.
@see @ref AbstractGroupedFeature3D, @ref AbstractBasicGroupedFeature2D @see @ref AbstractGroupedFeature3D, @ref AbstractBasicGroupedFeature2D
*/ */
template<class Derived, class T> using AbstractBasicGroupedFeature3D = AbstractGroupedFeature<3, Derived, T>; template<class Derived, class T> using AbstractBasicGroupedFeature3D = AbstractGroupedFeature<3, Derived, T>;
@ -146,12 +139,9 @@ template<class Derived, class T> using AbstractBasicGroupedFeature3D = AbstractG
Convenience alternative to <tt>%AbstractBasicGroupedFeature3D<Derived, Float></tt>. Convenience alternative to <tt>%AbstractBasicGroupedFeature3D<Derived, Float></tt>.
See @ref AbstractGroupedFeature for more information. See @ref AbstractGroupedFeature for more information.
@note Not available on GCC < 4.7. Use <tt>%AbstractGroupedFeature<3, Derived, Float></tt>
instead.
@see @ref AbstractGroupedFeature2D @see @ref AbstractGroupedFeature2D
*/ */
template<class Derived> using AbstractGroupedFeature3D = AbstractBasicGroupedFeature3D<Derived, Float>; template<class Derived> using AbstractGroupedFeature3D = AbstractBasicGroupedFeature3D<Derived, Float>;
#endif
}} }}

10
src/Magnum/SceneGraph/AbstractObject.h

@ -266,40 +266,30 @@ template<UnsignedInt dimensions, class T> class AbstractObject
virtual void doSetClean(const std::vector<std::reference_wrapper<AbstractObject<dimensions, T>>>& objects) = 0; virtual void doSetClean(const std::vector<std::reference_wrapper<AbstractObject<dimensions, T>>>& objects) = 0;
}; };
#ifndef CORRADE_GCC46_COMPATIBILITY
/** /**
@brief Base object for two-dimensional scenes @brief Base object for two-dimensional scenes
Convenience alternative to <tt>%AbstractObject<2, T></tt>. See Convenience alternative to <tt>%AbstractObject<2, T></tt>. See
@ref AbstractObject for more information. @ref AbstractObject for more information.
@note Not available on GCC < 4.7. Use <tt>%AbstractObject<2, T></tt> instead.
@see @ref AbstractObject2D, @ref AbstractBasicObject3D @see @ref AbstractObject2D, @ref AbstractBasicObject3D
*/ */
template<class T> using AbstractBasicObject2D = AbstractObject<2, T>; template<class T> using AbstractBasicObject2D = AbstractObject<2, T>;
#endif
/** /**
@brief Base object for two-dimensional float scenes @brief Base object for two-dimensional float scenes
@see @ref AbstractObject3D @see @ref AbstractObject3D
*/ */
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef AbstractBasicObject2D<Float> AbstractObject2D; typedef AbstractBasicObject2D<Float> AbstractObject2D;
#else
typedef AbstractObject<2, Float> AbstractObject2D;
#endif
#ifndef CORRADE_GCC46_COMPATIBILITY
/** /**
@brief Base object for three-dimensional scenes @brief Base object for three-dimensional scenes
Convenience alternative to <tt>%AbstractObject<3, T></tt>. See Convenience alternative to <tt>%AbstractObject<3, T></tt>. See
@ref AbstractObject for more information. @ref AbstractObject for more information.
@note Not available on GCC < 4.7. Use <tt>%AbstractObject<3, T></tt> instead.
@see @ref AbstractObject3D, @ref AbstractBasicObject2D @see @ref AbstractObject3D, @ref AbstractBasicObject2D
*/ */
template<class T> using AbstractBasicObject3D = AbstractObject<3, T>; template<class T> using AbstractBasicObject3D = AbstractObject<3, T>;
#endif
/** /**
@brief Base object for three-dimensional float scenes @brief Base object for three-dimensional float scenes

16
src/Magnum/SceneGraph/AbstractTransformation.h

@ -97,53 +97,37 @@ enum class TransformationType: UnsignedByte {
Local = 0x01 Local = 0x01
}; };
#ifndef CORRADE_GCC46_COMPATIBILITY
/** /**
@brief Base transformation for two-dimensional scenes @brief Base transformation for two-dimensional scenes
Convenience alternative to <tt>%AbstractTransformation<2, T></tt>. See Convenience alternative to <tt>%AbstractTransformation<2, T></tt>. See
@ref AbstractTransformation for more information. @ref AbstractTransformation for more information.
@note Not available on GCC < 4.7. Use <tt>%AbstractTransformation<2, T></tt>
instead.
@see @ref AbstractTransformation2D, @ref AbstractBasicTransformation3D @see @ref AbstractTransformation2D, @ref AbstractBasicTransformation3D
*/ */
template<class T> using AbstractBasicTransformation2D = AbstractTransformation<2, T>; template<class T> using AbstractBasicTransformation2D = AbstractTransformation<2, T>;
#endif
/** /**
@brief Base transformation for two-dimensional float scenes @brief Base transformation for two-dimensional float scenes
@see @ref AbstractTransformation3D @see @ref AbstractTransformation3D
*/ */
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef AbstractBasicTransformation2D<Float> AbstractTransformation2D; typedef AbstractBasicTransformation2D<Float> AbstractTransformation2D;
#else
typedef AbstractTransformation<2, Float> AbstractTransformation2D;
#endif
#ifndef CORRADE_GCC46_COMPATIBILITY
/** /**
@brief Base transformation for three-dimensional scenes @brief Base transformation for three-dimensional scenes
Convenience alternative to <tt>%AbstractTransformation<3, T></tt>. See Convenience alternative to <tt>%AbstractTransformation<3, T></tt>. See
@ref AbstractTransformation for more information. @ref AbstractTransformation for more information.
@note Not available on GCC < 4.7. Use <tt>%AbstractTransformation<3, T></tt>
instead.
@see @ref AbstractTransformation3D, @ref AbstractBasicTransformation2D @see @ref AbstractTransformation3D, @ref AbstractBasicTransformation2D
*/ */
template<class T> using AbstractBasicTransformation3D = AbstractTransformation<3, T>; template<class T> using AbstractBasicTransformation3D = AbstractTransformation<3, T>;
#endif
/** /**
@brief Base transformation for three-dimensional float scenes @brief Base transformation for three-dimensional float scenes
@see @ref AbstractTransformation2D @see @ref AbstractTransformation2D
*/ */
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef AbstractBasicTransformation3D<Float> AbstractTransformation3D; typedef AbstractBasicTransformation3D<Float> AbstractTransformation3D;
#else
typedef AbstractTransformation<3, Float> AbstractTransformation3D;
#endif
#ifdef CORRADE_TARGET_WINDOWS #ifdef CORRADE_TARGET_WINDOWS
extern template class MAGNUM_SCENEGRAPH_EXPORT AbstractTransformation<2, Float>; extern template class MAGNUM_SCENEGRAPH_EXPORT AbstractTransformation<2, Float>;

16
src/Magnum/SceneGraph/AbstractTranslation.h

@ -82,14 +82,11 @@ class AbstractTranslation: public AbstractTransformation<dimensions, T> {
virtual void doTranslate(const typename DimensionTraits<dimensions, TranslationType>::VectorType& vector, TransformationType type) = 0; virtual void doTranslate(const typename DimensionTraits<dimensions, TranslationType>::VectorType& vector, TransformationType type) = 0;
}; };
#ifndef CORRADE_GCC46_COMPATIBILITY
/** /**
@brief Base transformation for two-dimensional scenes supporting translation @brief Base transformation for two-dimensional scenes supporting translation
Convenience alternative to <tt>%AbstractTranslation<2, T, TranslationType></tt>. Convenience alternative to <tt>%AbstractTranslation<2, T, TranslationType></tt>.
See @ref AbstractTranslation for more information. See @ref AbstractTranslation for more information.
@note Not available on GCC < 4.7. Use <tt>%AbstractTranslation<2, T, TranslationType></tt>
instead.
@see @ref AbstractTranslation2D, @ref AbstractBasicTranslation3D @see @ref AbstractTranslation2D, @ref AbstractBasicTranslation3D
*/ */
#ifdef DOXYGEN_GENERATING_OUTPUT #ifdef DOXYGEN_GENERATING_OUTPUT
@ -98,27 +95,19 @@ template<class T, class TranslationType = T>
template<class T, class TranslationType> template<class T, class TranslationType>
#endif #endif
using AbstractBasicTranslation2D = AbstractTranslation<2, T, TranslationType>; using AbstractBasicTranslation2D = AbstractTranslation<2, T, TranslationType>;
#endif
/** /**
@brief Base transformation for two-dimensional float scenes supporting translation @brief Base transformation for two-dimensional float scenes supporting translation
@see @ref AbstractTranslation3D @see @ref AbstractTranslation3D
*/ */
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef AbstractBasicTranslation2D<Float> AbstractTranslation2D; typedef AbstractBasicTranslation2D<Float> AbstractTranslation2D;
#else
typedef AbstractTranslation<2, Float> AbstractTranslation2D;
#endif
#ifndef CORRADE_GCC46_COMPATIBILITY
/** /**
@brief Base transformation for three-dimensional scenes supporting translation @brief Base transformation for three-dimensional scenes supporting translation
Convenience alternative to <tt>%AbstractTranslation<3, T, TranslationType></tt>. Convenience alternative to <tt>%AbstractTranslation<3, T, TranslationType></tt>.
See @ref AbstractTranslation for more information. See @ref AbstractTranslation for more information.
@note Not available on GCC < 4.7. Use <tt>%AbstractTranslation<3, T, TranslationType></tt>
instead.
@see @ref AbstractTranslation3D, @ref AbstractBasicTranslation2D @see @ref AbstractTranslation3D, @ref AbstractBasicTranslation2D
*/ */
#ifdef DOXYGEN_GENERATING_OUTPUT #ifdef DOXYGEN_GENERATING_OUTPUT
@ -127,18 +116,13 @@ template<class T, class TranslationType = T>
template<class T, class TranslationType> template<class T, class TranslationType>
#endif #endif
using AbstractBasicTranslation3D = AbstractTranslation<3, T, TranslationType>; using AbstractBasicTranslation3D = AbstractTranslation<3, T, TranslationType>;
#endif
/** /**
@brief Base transformation for three-dimensional float scenes supporting translation @brief Base transformation for three-dimensional float scenes supporting translation
@see @ref AbstractTranslation2D @see @ref AbstractTranslation2D
*/ */
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef AbstractBasicTranslation3D<Float> AbstractTranslation3D; typedef AbstractBasicTranslation3D<Float> AbstractTranslation3D;
#else
typedef AbstractTranslation<3, Float> AbstractTranslation3D;
#endif
}} }}

14
src/Magnum/SceneGraph/Animable.h

@ -336,51 +336,37 @@ template<UnsignedInt dimensions, class T> class Animable: public AbstractGrouped
UnsignedShort repeats; UnsignedShort repeats;
}; };
#ifndef CORRADE_GCC46_COMPATIBILITY
/** /**
@brief %Animable for two-dimensional scenes @brief %Animable for two-dimensional scenes
Convenience alternative to <tt>%Animable<2, T></tt>. See @ref Animable for more Convenience alternative to <tt>%Animable<2, T></tt>. See @ref Animable for more
information. information.
@note Not available on GCC < 4.7. Use <tt>%Animable<2, T></tt> instead.
@see @ref Animable2D, @ref BasicAnimable3D @see @ref Animable2D, @ref BasicAnimable3D
*/ */
template<class T> using BasicAnimable2D = Animable<2, T>; template<class T> using BasicAnimable2D = Animable<2, T>;
#endif
/** /**
@brief %Animable for two-dimensional float scenes @brief %Animable for two-dimensional float scenes
@see @ref Animable3D @see @ref Animable3D
*/ */
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef BasicAnimable2D<Float> Animable2D; typedef BasicAnimable2D<Float> Animable2D;
#else
typedef Animable<2, Float> Animable2D;
#endif
#ifndef CORRADE_GCC46_COMPATIBILITY
/** /**
@brief %Animable for three-dimensional scenes @brief %Animable for three-dimensional scenes
Convenience alternative to <tt>%Animable<3, T></tt>. See @ref Animable for more Convenience alternative to <tt>%Animable<3, T></tt>. See @ref Animable for more
information. information.
@note Not available on GCC < 4.7. Use <tt>%Animable<3, T></tt> instead.
@see @ref Animable3D, @ref BasicAnimable2D @see @ref Animable3D, @ref BasicAnimable2D
*/ */
template<class T> using BasicAnimable3D = Animable<3, T>; template<class T> using BasicAnimable3D = Animable<3, T>;
#endif
/** /**
@brief %Animable for three-dimensional float scenes @brief %Animable for three-dimensional float scenes
@see @ref Animable2D @see @ref Animable2D
*/ */
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef BasicAnimable3D<Float> Animable3D; typedef BasicAnimable3D<Float> Animable3D;
#else
typedef Animable<3, Float> Animable3D;
#endif
#ifdef CORRADE_TARGET_WINDOWS #ifdef CORRADE_TARGET_WINDOWS
extern template class MAGNUM_SCENEGRAPH_EXPORT Animable<2, Float>; extern template class MAGNUM_SCENEGRAPH_EXPORT Animable<2, Float>;

14
src/Magnum/SceneGraph/AnimableGroup.h

@ -72,51 +72,37 @@ template<UnsignedInt dimensions, class T> class AnimableGroup: public FeatureGro
bool wakeUp; bool wakeUp;
}; };
#ifndef CORRADE_GCC46_COMPATIBILITY
/** /**
@brief %Animable group for two-dimensional scenes @brief %Animable group for two-dimensional scenes
Convenience alternative to <tt>%AnimableGroup<2, T></tt>. See Animable for Convenience alternative to <tt>%AnimableGroup<2, T></tt>. See Animable for
more information. more information.
@note Not available on GCC < 4.7. Use <tt>%AnimableGroup<2, T></tt> instead.
@see @ref AnimableGroup2D, @ref BasicAnimableGroup3D @see @ref AnimableGroup2D, @ref BasicAnimableGroup3D
*/ */
template<class T> using BasicAnimableGroup2D = AnimableGroup<2, T>; template<class T> using BasicAnimableGroup2D = AnimableGroup<2, T>;
#endif
/** /**
@brief %Animable group for two-dimensional float scenes @brief %Animable group for two-dimensional float scenes
@see @ref AnimableGroup3D @see @ref AnimableGroup3D
*/ */
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef BasicAnimableGroup2D<Float> AnimableGroup2D; typedef BasicAnimableGroup2D<Float> AnimableGroup2D;
#else
typedef AnimableGroup<2, Float> AnimableGroup2D;
#endif
#ifndef CORRADE_GCC46_COMPATIBILITY
/** /**
@brief %Animable group for three-dimensional scenes @brief %Animable group for three-dimensional scenes
Convenience alternative to <tt>%AnimableGroup<3, T></tt>. See Animable for Convenience alternative to <tt>%AnimableGroup<3, T></tt>. See Animable for
more information. more information.
@note Not available on GCC < 4.7. Use <tt>%AnimableGroup<3, T></tt> instead.
@see @ref AnimableGroup3D, @ref BasicAnimableGroup2D @see @ref AnimableGroup3D, @ref BasicAnimableGroup2D
*/ */
template<class T> using BasicAnimableGroup3D = AnimableGroup<3, T>; template<class T> using BasicAnimableGroup3D = AnimableGroup<3, T>;
#endif
/** /**
@brief %Animable group for three-dimensional float scenes @brief %Animable group for three-dimensional float scenes
@see @ref AnimableGroup2D @see @ref AnimableGroup2D
*/ */
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef BasicAnimableGroup3D<Float> AnimableGroup3D; typedef BasicAnimableGroup3D<Float> AnimableGroup3D;
#else
typedef AnimableGroup<3, Float> AnimableGroup3D;
#endif
#ifdef CORRADE_TARGET_WINDOWS #ifdef CORRADE_TARGET_WINDOWS
extern template class MAGNUM_SCENEGRAPH_EXPORT AnimableGroup<2, Float>; extern template class MAGNUM_SCENEGRAPH_EXPORT AnimableGroup<2, Float>;

7
src/Magnum/SceneGraph/Camera2D.h

@ -73,12 +73,7 @@ template<class T> class BasicCamera2D: public AbstractCamera<2, T> {
/* This is here to avoid ambiguity with deleted copy constructor when /* This is here to avoid ambiguity with deleted copy constructor when
passing `*this` from class subclassing both BasicCamera2D and passing `*this` from class subclassing both BasicCamera2D and
AbstractObject */ AbstractObject */
template<class U, class = typename std::enable_if<std::is_base_of<AbstractObject<2, T>, U>::value>::type> BasicCamera2D(U& object): template<class U, class = typename std::enable_if<std::is_base_of<AbstractObject<2, T>, U>::value>::type> BasicCamera2D(U& object): BasicCamera2D(static_cast<AbstractObject<2, T>&>(object)) {}
#ifndef CORRADE_GCC46_COMPATIBILITY
BasicCamera2D(static_cast<AbstractObject<2, T>&>(object)) {}
#else
AbstractCamera<2, T>(static_cast<AbstractObject<2, T>&>(object)) {}
#endif
#endif #endif
/** /**

7
src/Magnum/SceneGraph/Camera3D.h

@ -75,12 +75,7 @@ template<class T> class BasicCamera3D: public AbstractCamera<3, T> {
/* This is here to avoid ambiguity with deleted copy constructor when /* This is here to avoid ambiguity with deleted copy constructor when
passing `*this` from class subclassing both BasicCamera3D and passing `*this` from class subclassing both BasicCamera3D and
AbstractObject */ AbstractObject */
template<class U, class = typename std::enable_if<std::is_base_of<AbstractObject<3, T>, U>::value>::type> BasicCamera3D(U& object): template<class U, class = typename std::enable_if<std::is_base_of<AbstractObject<3, T>, U>::value>::type> BasicCamera3D(U& object): BasicCamera3D(static_cast<AbstractObject<3, T>&>(object)) {}
#ifndef CORRADE_GCC46_COMPATIBILITY
BasicCamera3D(static_cast<AbstractObject<3, T>&>(object)) {}
#else
AbstractCamera<3, T>(static_cast<AbstractObject<3, T>&>(object)) {}
#endif
#endif #endif
/** /**

40
src/Magnum/SceneGraph/Drawable.h

@ -148,20 +148,12 @@ template<UnsignedInt dimensions, class T> class Drawable: public AbstractGrouped
* If the drawable doesn't belong to any group, returns `nullptr`. * If the drawable doesn't belong to any group, returns `nullptr`.
*/ */
DrawableGroup<dimensions, T>* drawables() { DrawableGroup<dimensions, T>* drawables() {
#ifndef CORRADE_GCC46_COMPATIBILITY
return AbstractGroupedFeature<dimensions, Drawable<dimensions, T>, T>::group(); return AbstractGroupedFeature<dimensions, Drawable<dimensions, T>, T>::group();
#else
return static_cast<DrawableGroup<dimensions, T>*>(AbstractGroupedFeature<dimensions, Drawable<dimensions, T>, T>::group());
#endif
} }
/** @overload */ /** @overload */
const DrawableGroup<dimensions, T>* drawables() const { const DrawableGroup<dimensions, T>* drawables() const {
#ifndef CORRADE_GCC46_COMPATIBILITY
return AbstractGroupedFeature<dimensions, Drawable<dimensions, T>, T>::group(); return AbstractGroupedFeature<dimensions, Drawable<dimensions, T>, T>::group();
#else
return static_cast<const DrawableGroup<dimensions, T>*>(AbstractGroupedFeature<dimensions, Drawable<dimensions, T>, T>::group());
#endif
} }
/** /**
@ -176,51 +168,37 @@ template<UnsignedInt dimensions, class T> class Drawable: public AbstractGrouped
virtual void draw(const typename DimensionTraits<dimensions, T>::MatrixType& transformationMatrix, AbstractCamera<dimensions, T>& camera) = 0; virtual void draw(const typename DimensionTraits<dimensions, T>::MatrixType& transformationMatrix, AbstractCamera<dimensions, T>& camera) = 0;
}; };
#ifndef CORRADE_GCC46_COMPATIBILITY
/** /**
@brief %Drawable for two-dimensional scenes @brief %Drawable for two-dimensional scenes
Convenience alternative to <tt>%Drawable<2, T></tt>. See @ref Drawable for more Convenience alternative to <tt>%Drawable<2, T></tt>. See @ref Drawable for more
information. information.
@note Not available on GCC < 4.7. Use <tt>%Drawable<2, T></tt> instead.
@see @ref Drawable2D, @ref BasicDrawable3D @see @ref Drawable2D, @ref BasicDrawable3D
*/ */
template<class T> using BasicDrawable2D = Drawable<2, T>; template<class T> using BasicDrawable2D = Drawable<2, T>;
#endif
/** /**
@brief %Drawable for two-dimensional float scenes @brief %Drawable for two-dimensional float scenes
@see @ref Drawable3D @see @ref Drawable3D
*/ */
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef BasicDrawable2D<Float> Drawable2D; typedef BasicDrawable2D<Float> Drawable2D;
#else
typedef Drawable<2, Float> Drawable2D;
#endif
#ifndef CORRADE_GCC46_COMPATIBILITY
/** /**
@brief %Drawable for three-dimensional scenes @brief %Drawable for three-dimensional scenes
Convenience alternative to <tt>%Drawable<3, T></tt>. See @ref Drawable for more Convenience alternative to <tt>%Drawable<3, T></tt>. See @ref Drawable for more
information. information.
@note Not available on GCC < 4.7. Use <tt>%Drawable<3, T></tt> instead.
@see @ref Drawable3D, @ref BasicDrawable3D @see @ref Drawable3D, @ref BasicDrawable3D
*/ */
template<class T> using BasicDrawable3D = Drawable<3, T>; template<class T> using BasicDrawable3D = Drawable<3, T>;
#endif
/** /**
@brief %Drawable for three-dimensional float scenes @brief %Drawable for three-dimensional float scenes
@see @ref Drawable2D @see @ref Drawable2D
*/ */
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef BasicDrawable3D<Float> Drawable3D; typedef BasicDrawable3D<Float> Drawable3D;
#else
typedef Drawable<3, Float> Drawable3D;
#endif
/** /**
@brief Group of drawables @brief Group of drawables
@ -229,57 +207,39 @@ See @ref Drawable for more information.
@see @ref scenegraph, @ref BasicDrawableGroup2D, @ref BasicDrawableGroup3D, @see @ref scenegraph, @ref BasicDrawableGroup2D, @ref BasicDrawableGroup3D,
@ref DrawableGroup2D, @ref DrawableGroup3D @ref DrawableGroup2D, @ref DrawableGroup3D
*/ */
#ifndef CORRADE_GCC46_COMPATIBILITY
template<UnsignedInt dimensions, class T> using DrawableGroup = FeatureGroup<dimensions, Drawable<dimensions, T>, T>; template<UnsignedInt dimensions, class T> using DrawableGroup = FeatureGroup<dimensions, Drawable<dimensions, T>, T>;
#else
template<UnsignedInt dimensions, class T> class DrawableGroup: public FeatureGroup<dimensions, Drawable<dimensions, T>, T> {};
#endif
#ifndef CORRADE_GCC46_COMPATIBILITY
/** /**
@brief Group of drawables for two-dimensional scenes @brief Group of drawables for two-dimensional scenes
Convenience alternative to <tt>%DrawableGroup<2, T></tt>. See @ref Drawable for Convenience alternative to <tt>%DrawableGroup<2, T></tt>. See @ref Drawable for
more information. more information.
@note Not available on GCC < 4.7. Use <tt>%DrawableGroup<2, T></tt> instead.
@see @ref DrawableGroup2D, @ref BasicDrawableGroup3D @see @ref DrawableGroup2D, @ref BasicDrawableGroup3D
*/ */
template<class T> using BasicDrawableGroup2D = DrawableGroup<2, T>; template<class T> using BasicDrawableGroup2D = DrawableGroup<2, T>;
#endif
/** /**
@brief Group of drawables for two-dimensional float scenes @brief Group of drawables for two-dimensional float scenes
@see @ref DrawableGroup3D @see @ref DrawableGroup3D
*/ */
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef BasicDrawableGroup2D<Float> DrawableGroup2D; typedef BasicDrawableGroup2D<Float> DrawableGroup2D;
#else
typedef DrawableGroup<2, Float> DrawableGroup2D;
#endif
#ifndef CORRADE_GCC46_COMPATIBILITY
/** /**
@brief Group of drawables for three-dimensional scenes @brief Group of drawables for three-dimensional scenes
Convenience alternative to <tt>%DrawableGroup<3, T></tt>. See @ref Drawable for Convenience alternative to <tt>%DrawableGroup<3, T></tt>. See @ref Drawable for
more information. more information.
@note Not available on GCC < 4.7. Use <tt>%DrawableGroup<3, T></tt> instead.
@see @ref DrawableGroup3D, @ref BasicDrawableGroup2D @see @ref DrawableGroup3D, @ref BasicDrawableGroup2D
*/ */
template<class T> using BasicDrawableGroup3D = DrawableGroup<3, T>; template<class T> using BasicDrawableGroup3D = DrawableGroup<3, T>;
#endif
/** /**
@brief Group of drawables for three-dimensional float scenes @brief Group of drawables for three-dimensional float scenes
@see @ref DrawableGroup2D @see @ref DrawableGroup2D
*/ */
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef BasicDrawableGroup3D<Float> DrawableGroup3D; typedef BasicDrawableGroup3D<Float> DrawableGroup3D;
#else
typedef DrawableGroup<3, Float> DrawableGroup3D;
#endif
#ifdef CORRADE_TARGET_WINDOWS #ifdef CORRADE_TARGET_WINDOWS
extern template class MAGNUM_SCENEGRAPH_EXPORT Drawable<2, Float>; extern template class MAGNUM_SCENEGRAPH_EXPORT Drawable<2, Float>;

10
src/Magnum/SceneGraph/FeatureGroup.h

@ -113,14 +113,11 @@ template<UnsignedInt dimensions, class Feature, class T> class FeatureGroup: pub
FeatureGroup<dimensions, Feature, T>& remove(Feature& feature); FeatureGroup<dimensions, Feature, T>& remove(Feature& feature);
}; };
#ifndef CORRADE_GCC46_COMPATIBILITY
/** /**
@brief Base feature group for two-dimensional scenes @brief Base feature group for two-dimensional scenes
Convenience alternative to <tt>%FeatureGroup<2, Feature, T></tt>. See Convenience alternative to <tt>%FeatureGroup<2, Feature, T></tt>. See
@ref AbstractGroupedFeature for more information. @ref AbstractGroupedFeature for more information.
@note Not available on GCC < 4.7. Use <tt>%FeatureGroup<2, Feature, T></tt>
instead.
@see @ref FeatureGroup2D, @ref BasicFeatureGroup3D @see @ref FeatureGroup2D, @ref BasicFeatureGroup3D
*/ */
template<class Feature, class T> using BasicFeatureGroup2D = FeatureGroup<2, Feature, T>; template<class Feature, class T> using BasicFeatureGroup2D = FeatureGroup<2, Feature, T>;
@ -130,8 +127,6 @@ template<class Feature, class T> using BasicFeatureGroup2D = FeatureGroup<2, Fea
Convenience alternative to <tt>%BasicFeatureGroup2D<Feature, Float></tt>. See Convenience alternative to <tt>%BasicFeatureGroup2D<Feature, Float></tt>. See
@ref AbstractGroupedFeature for more information. @ref AbstractGroupedFeature for more information.
@note Not available on GCC < 4.7. Use <tt>%FeatureGroup<2, Feature, Float></tt>
instead.
@see @ref FeatureGroup3D @see @ref FeatureGroup3D
*/ */
template<class Feature> using FeatureGroup2D = BasicFeatureGroup2D<Feature, Float>; template<class Feature> using FeatureGroup2D = BasicFeatureGroup2D<Feature, Float>;
@ -141,8 +136,6 @@ template<class Feature> using FeatureGroup2D = BasicFeatureGroup2D<Feature, Floa
Convenience alternative to <tt>%FeatureGroup<3, Feature, T></tt>. See Convenience alternative to <tt>%FeatureGroup<3, Feature, T></tt>. See
@ref AbstractGroupedFeature for more information. @ref AbstractGroupedFeature for more information.
@note Not available on GCC < 4.7. Use <tt>%FeatureGroup<3, Feature, T></tt>
instead.
@see @ref FeatureGroup3D, @ref BasicFeatureGroup2D @see @ref FeatureGroup3D, @ref BasicFeatureGroup2D
*/ */
template<class Feature, class T> using BasicFeatureGroup3D = FeatureGroup<3, Feature, T>; template<class Feature, class T> using BasicFeatureGroup3D = FeatureGroup<3, Feature, T>;
@ -152,12 +145,9 @@ template<class Feature, class T> using BasicFeatureGroup3D = FeatureGroup<3, Fea
Convenience alternative to <tt>%BasicFeatureGroup3D<Feature, Float></tt>. See Convenience alternative to <tt>%BasicFeatureGroup3D<Feature, Float></tt>. See
@ref AbstractGroupedFeature for more information. @ref AbstractGroupedFeature for more information.
@note Not available on GCC < 4.7. Use <tt>%FeatureGroup<3, Feature, Float></tt>
instead.
@see @ref FeatureGroup2D @see @ref FeatureGroup2D
*/ */
template<class Feature> using FeatureGroup3D = BasicFeatureGroup3D<Feature, Float>; template<class Feature> using FeatureGroup3D = BasicFeatureGroup3D<Feature, Float>;
#endif
template<UnsignedInt dimensions, class Feature, class T> FeatureGroup<dimensions, Feature, T>::~FeatureGroup() { template<UnsignedInt dimensions, class Feature, class T> FeatureGroup<dimensions, Feature, T>::~FeatureGroup() {
for(auto i: AbstractFeatureGroup<dimensions, T>::features) static_cast<Feature&>(i.get())._group = nullptr; for(auto i: AbstractFeatureGroup<dimensions, T>::features) static_cast<Feature&>(i.get())._group = nullptr;

54
src/Magnum/SceneGraph/SceneGraph.h

@ -29,8 +29,6 @@
* @brief Forward declarations for @ref Magnum::SceneGraph namespace * @brief Forward declarations for @ref Magnum::SceneGraph namespace
*/ */
#include <Corrade/compatibility.h>
#include "Magnum/Types.h" #include "Magnum/Types.h"
namespace Magnum { namespace SceneGraph { namespace Magnum { namespace SceneGraph {
@ -38,73 +36,46 @@ namespace Magnum { namespace SceneGraph {
enum class AspectRatioPolicy: UnsignedByte; enum class AspectRatioPolicy: UnsignedByte;
template<UnsignedInt, class> class AbstractCamera; template<UnsignedInt, class> class AbstractCamera;
#ifndef CORRADE_GCC46_COMPATIBILITY
template<class T> using AbstractBasicCamera2D = AbstractCamera<2, T>; template<class T> using AbstractBasicCamera2D = AbstractCamera<2, T>;
template<class T> using AbstractBasicCamera3D = AbstractCamera<3, T>; template<class T> using AbstractBasicCamera3D = AbstractCamera<3, T>;
typedef AbstractBasicCamera2D<Float> AbstractCamera2D; typedef AbstractBasicCamera2D<Float> AbstractCamera2D;
typedef AbstractBasicCamera3D<Float> AbstractCamera3D; typedef AbstractBasicCamera3D<Float> AbstractCamera3D;
#else
typedef AbstractCamera<2, Float> AbstractCamera2D;
typedef AbstractCamera<3, Float> AbstractCamera3D;
#endif
/* Enum CachedTransformation and CachedTransformations used only directly */ /* Enum CachedTransformation and CachedTransformations used only directly */
template<UnsignedInt, class> class AbstractFeature; template<UnsignedInt, class> class AbstractFeature;
#ifndef CORRADE_GCC46_COMPATIBILITY
template<class T> using AbstractBasicFeature2D = AbstractFeature<2, T>; template<class T> using AbstractBasicFeature2D = AbstractFeature<2, T>;
template<class T> using AbstractBasicFeature3D = AbstractFeature<3, T>; template<class T> using AbstractBasicFeature3D = AbstractFeature<3, T>;
typedef AbstractBasicFeature2D<Float> AbstractFeature2D; typedef AbstractBasicFeature2D<Float> AbstractFeature2D;
typedef AbstractBasicFeature3D<Float> AbstractFeature3D; typedef AbstractBasicFeature3D<Float> AbstractFeature3D;
#else
typedef AbstractFeature<2, Float> AbstractFeature2D;
typedef AbstractFeature<3, Float> AbstractFeature3D;
#endif
/* AbstractFeatureGroup shouldn't be used directly */ /* AbstractFeatureGroup shouldn't be used directly */
template<UnsignedInt, class, class> class AbstractGroupedFeature; template<UnsignedInt, class, class> class AbstractGroupedFeature;
#ifndef CORRADE_GCC46_COMPATIBILITY
template<class Derived, class T> using AbstractBasicGroupedFeature2D = AbstractGroupedFeature<2, Derived, T>; template<class Derived, class T> using AbstractBasicGroupedFeature2D = AbstractGroupedFeature<2, Derived, T>;
template<class Derived, class T> using AbstractBasicGroupedFeature3D = AbstractGroupedFeature<3, Derived, T>; template<class Derived, class T> using AbstractBasicGroupedFeature3D = AbstractGroupedFeature<3, Derived, T>;
template<class Derived> using AbstractGroupedFeature2D = AbstractBasicGroupedFeature2D<Derived, Float>; template<class Derived> using AbstractGroupedFeature2D = AbstractBasicGroupedFeature2D<Derived, Float>;
template<class Derived> using AbstractGroupedFeature3D = AbstractBasicGroupedFeature3D<Derived, Float>; template<class Derived> using AbstractGroupedFeature3D = AbstractBasicGroupedFeature3D<Derived, Float>;
#endif
template<UnsignedInt, class> class AbstractObject; template<UnsignedInt, class> class AbstractObject;
#ifndef CORRADE_GCC46_COMPATIBILITY
template<class T> using AbstractBasicObject2D = AbstractObject<2, T>; template<class T> using AbstractBasicObject2D = AbstractObject<2, T>;
template<class T> using AbstractBasicObject3D = AbstractObject<3, T>; template<class T> using AbstractBasicObject3D = AbstractObject<3, T>;
typedef AbstractBasicObject2D<Float> AbstractObject2D; typedef AbstractBasicObject2D<Float> AbstractObject2D;
typedef AbstractBasicObject3D<Float> AbstractObject3D; typedef AbstractBasicObject3D<Float> AbstractObject3D;
#else
typedef AbstractObject<2, Float> AbstractObject2D;
typedef AbstractObject<3, Float> AbstractObject3D;
#endif
enum class TransformationType: UnsignedByte; enum class TransformationType: UnsignedByte;
template<UnsignedInt, class> class AbstractTransformation; template<UnsignedInt, class> class AbstractTransformation;
#ifndef CORRADE_GCC46_COMPATIBILITY
template<class T> using AbstractBasicTransformation2D = AbstractTransformation<2, T>; template<class T> using AbstractBasicTransformation2D = AbstractTransformation<2, T>;
template<class T> using AbstractBasicTransformation3D = AbstractTransformation<3, T>; template<class T> using AbstractBasicTransformation3D = AbstractTransformation<3, T>;
typedef AbstractBasicTransformation2D<Float> AbstractTransformation2D; typedef AbstractBasicTransformation2D<Float> AbstractTransformation2D;
typedef AbstractBasicTransformation3D<Float> AbstractTransformation3D; typedef AbstractBasicTransformation3D<Float> AbstractTransformation3D;
#else
typedef AbstractTransformation<2, Float> AbstractTransformation2D;
typedef AbstractTransformation<3, Float> AbstractTransformation3D;
#endif
template<UnsignedInt, class T, class = T> class AbstractTranslation; template<UnsignedInt, class T, class = T> class AbstractTranslation;
#ifndef CORRADE_GCC46_COMPATIBILITY
template<class T, class TranslationType = T> using AbstractBasicTranslation2D = AbstractTranslation<2, T, TranslationType>; template<class T, class TranslationType = T> using AbstractBasicTranslation2D = AbstractTranslation<2, T, TranslationType>;
template<class T, class TranslationType = T> using AbstractBasicTranslation3D = AbstractTranslation<3, T, TranslationType>; template<class T, class TranslationType = T> using AbstractBasicTranslation3D = AbstractTranslation<3, T, TranslationType>;
typedef AbstractBasicTranslation2D<Float> AbstractTranslation2D; typedef AbstractBasicTranslation2D<Float> AbstractTranslation2D;
typedef AbstractBasicTranslation3D<Float> AbstractTranslation3D; typedef AbstractBasicTranslation3D<Float> AbstractTranslation3D;
#else
typedef AbstractTranslation<2, Float> AbstractTranslation2D;
typedef AbstractTranslation<3, Float> AbstractTranslation3D;
#endif
template<class> class AbstractBasicTranslationRotation2D; template<class> class AbstractBasicTranslationRotation2D;
template<class> class AbstractBasicTranslationRotation3D; template<class> class AbstractBasicTranslationRotation3D;
@ -117,28 +88,18 @@ typedef AbstractBasicTranslationRotationScaling2D<Float> AbstractTranslationRota
typedef AbstractBasicTranslationRotationScaling3D<Float> AbstractTranslationRotationScaling3D; typedef AbstractBasicTranslationRotationScaling3D<Float> AbstractTranslationRotationScaling3D;
template<UnsignedInt, class> class Animable; template<UnsignedInt, class> class Animable;
#ifndef CORRADE_GCC46_COMPATIBILITY
template<class T> using BasicAnimable2D = Animable<2, T>; template<class T> using BasicAnimable2D = Animable<2, T>;
template<class T> using BasicAnimable3D = Animable<3, T>; template<class T> using BasicAnimable3D = Animable<3, T>;
typedef BasicAnimable2D<Float> Animable2D; typedef BasicAnimable2D<Float> Animable2D;
typedef BasicAnimable3D<Float> Animable3D; typedef BasicAnimable3D<Float> Animable3D;
#else
typedef Animable<2, Float> Animable2D;
typedef Animable<3, Float> Animable3D;
#endif
enum class AnimationState: UnsignedByte; enum class AnimationState: UnsignedByte;
template<UnsignedInt, class> class AnimableGroup; template<UnsignedInt, class> class AnimableGroup;
#ifndef CORRADE_GCC46_COMPATIBILITY
template<class T> using BasicAnimableGroup2D = AnimableGroup<2, T>; template<class T> using BasicAnimableGroup2D = AnimableGroup<2, T>;
template<class T> using BasicAnimableGroup3D = AnimableGroup<3, T>; template<class T> using BasicAnimableGroup3D = AnimableGroup<3, T>;
typedef BasicAnimableGroup2D<Float> AnimableGroup2D; typedef BasicAnimableGroup2D<Float> AnimableGroup2D;
typedef BasicAnimableGroup3D<Float> AnimableGroup3D; typedef BasicAnimableGroup3D<Float> AnimableGroup3D;
#else
typedef AnimableGroup<2, Float> AnimableGroup2D;
typedef AnimableGroup<3, Float> AnimableGroup3D;
#endif
template<class> class BasicCamera2D; template<class> class BasicCamera2D;
template<class> class BasicCamera3D; template<class> class BasicCamera3D;
@ -146,12 +107,10 @@ typedef BasicCamera2D<Float> Camera2D;
typedef BasicCamera3D<Float> Camera3D; typedef BasicCamera3D<Float> Camera3D;
template<UnsignedInt, class> class Drawable; template<UnsignedInt, class> class Drawable;
#ifndef CORRADE_GCC46_COMPATIBILITY
template<class T> using BasicDrawable2D = Drawable<2, T>; template<class T> using BasicDrawable2D = Drawable<2, T>;
template<class T> using BasicDrawable3D = Drawable<3, T>; template<class T> using BasicDrawable3D = Drawable<3, T>;
typedef BasicDrawable2D<Float> Drawable2D; typedef BasicDrawable2D<Float> Drawable2D;
typedef BasicDrawable3D<Float> Drawable3D; typedef BasicDrawable3D<Float> Drawable3D;
#endif
template<class> class BasicDualComplexTransformation; template<class> class BasicDualComplexTransformation;
template<class> class BasicDualQuaternionTransformation; template<class> class BasicDualQuaternionTransformation;
@ -159,24 +118,16 @@ typedef BasicDualComplexTransformation<Float> DualComplexTransformation;
typedef BasicDualQuaternionTransformation<Float> DualQuaternionTransformation; typedef BasicDualQuaternionTransformation<Float> DualQuaternionTransformation;
template<UnsignedInt, class, class> class FeatureGroup; template<UnsignedInt, class, class> class FeatureGroup;
#ifndef CORRADE_GCC46_COMPATIBILITY
template<class Feature, class T> using BasicFeatureGroup2D = FeatureGroup<2, Feature, T>; template<class Feature, class T> using BasicFeatureGroup2D = FeatureGroup<2, Feature, T>;
template<class Feature, class T> using BasicFeatureGroup3D = FeatureGroup<3, Feature, T>; template<class Feature, class T> using BasicFeatureGroup3D = FeatureGroup<3, Feature, T>;
template<class Feature> using FeatureGroup2D = BasicFeatureGroup2D<Feature, Float>; template<class Feature> using FeatureGroup2D = BasicFeatureGroup2D<Feature, Float>;
template<class Feature> using FeatureGroup3D = BasicFeatureGroup3D<Feature, Float>; template<class Feature> using FeatureGroup3D = BasicFeatureGroup3D<Feature, Float>;
#endif
#ifndef CORRADE_GCC46_COMPATIBILITY
template<UnsignedInt dimensions, class T> using DrawableGroup = FeatureGroup<dimensions, Drawable<dimensions, T>, T>; template<UnsignedInt dimensions, class T> using DrawableGroup = FeatureGroup<dimensions, Drawable<dimensions, T>, T>;
template<class T> using BasicDrawableGroup2D = DrawableGroup<2, T>; template<class T> using BasicDrawableGroup2D = DrawableGroup<2, T>;
template<class T> using BasicDrawableGroup3D = DrawableGroup<3, T>; template<class T> using BasicDrawableGroup3D = DrawableGroup<3, T>;
typedef BasicDrawableGroup2D<Float> DrawableGroup2D; typedef BasicDrawableGroup2D<Float> DrawableGroup2D;
typedef BasicDrawableGroup3D<Float> DrawableGroup3D; typedef BasicDrawableGroup3D<Float> DrawableGroup3D;
#else
template<UnsignedInt, class> class DrawableGroup;
typedef DrawableGroup<2, Float> DrawableGroup2D;
typedef DrawableGroup<3, Float> DrawableGroup3D;
#endif
template<class> class BasicMatrixTransformation2D; template<class> class BasicMatrixTransformation2D;
template<class> class BasicMatrixTransformation3D; template<class> class BasicMatrixTransformation3D;
@ -193,15 +144,10 @@ typedef BasicRigidMatrixTransformation3D<Float> RigidMatrixTransformation3D;
template<class Transformation> class Scene; template<class Transformation> class Scene;
template<UnsignedInt, class T, class = T> class TranslationTransformation; template<UnsignedInt, class T, class = T> class TranslationTransformation;
#ifndef CORRADE_GCC46_COMPATIBILITY
template<class T, class TranslationType = T> using BasicTranslationTransformation2D = TranslationTransformation<2, T, TranslationType>; template<class T, class TranslationType = T> using BasicTranslationTransformation2D = TranslationTransformation<2, T, TranslationType>;
template<class T, class TranslationType = T> using BasicTranslationTransformation3D = TranslationTransformation<3, T, TranslationType>; template<class T, class TranslationType = T> using BasicTranslationTransformation3D = TranslationTransformation<3, T, TranslationType>;
typedef BasicTranslationTransformation2D<Float> TranslationTransformation2D; typedef BasicTranslationTransformation2D<Float> TranslationTransformation2D;
typedef BasicTranslationTransformation3D<Float> TranslationTransformation3D; typedef BasicTranslationTransformation3D<Float> TranslationTransformation3D;
#else
typedef TranslationTransformation<2, Float> TranslationTransformation2D;
typedef TranslationTransformation<3, Float> TranslationTransformation3D;
#endif
namespace Implementation { namespace Implementation {
template<class> struct Transformation; template<class> struct Transformation;

16
src/Magnum/SceneGraph/TranslationTransformation.h

@ -126,14 +126,11 @@ class TranslationTransformation: public AbstractTranslation<dimensions, T, Trans
typename DimensionTraits<dimensions, TranslationType>::VectorType _transformation; typename DimensionTraits<dimensions, TranslationType>::VectorType _transformation;
}; };
#ifndef CORRADE_GCC46_COMPATIBILITY
/** /**
@brief Base transformation for two-dimensional scenes supporting translation @brief Base transformation for two-dimensional scenes supporting translation
Convenience alternative to <tt>%TranslationTransformation<2, T, TranslationType></tt>. Convenience alternative to <tt>%TranslationTransformation<2, T, TranslationType></tt>.
See @ref TranslationTransformation for more information. See @ref TranslationTransformation for more information.
@note Not available on GCC < 4.7. Use <tt>%TranslationTransformation<2, T, TranslationType></tt>
instead.
@see @ref TranslationTransformation2D, @ref BasicTranslationTransformation3D @see @ref TranslationTransformation2D, @ref BasicTranslationTransformation3D
*/ */
#ifdef DOXYGEN_GENERATING_OUTPUT #ifdef DOXYGEN_GENERATING_OUTPUT
@ -142,27 +139,19 @@ template<class T, class TranslationType = T>
template<class T, class TranslationType> template<class T, class TranslationType>
#endif #endif
using BasicTranslationTransformation2D = TranslationTransformation<2, T, TranslationType>; using BasicTranslationTransformation2D = TranslationTransformation<2, T, TranslationType>;
#endif
/** /**
@brief Base transformation for two-dimensional float scenes supporting translation @brief Base transformation for two-dimensional float scenes supporting translation
@see @ref TranslationTransformation3D @see @ref TranslationTransformation3D
*/ */
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef BasicTranslationTransformation2D<Float> TranslationTransformation2D; typedef BasicTranslationTransformation2D<Float> TranslationTransformation2D;
#else
typedef TranslationTransformation<2, Float> TranslationTransformation2D;
#endif
#ifndef CORRADE_GCC46_COMPATIBILITY
/** /**
@brief Base transformation for three-dimensional scenes supporting translation @brief Base transformation for three-dimensional scenes supporting translation
Convenience alternative to <tt>%TranslationTransformation<3, T, TranslationType></tt>. Convenience alternative to <tt>%TranslationTransformation<3, T, TranslationType></tt>.
See @ref TranslationTransformation for more information. See @ref TranslationTransformation for more information.
@note Not available on GCC < 4.7. Use <tt>%TranslationTransformation<3, T, TranslationType></tt>
instead.
@see @ref TranslationTransformation3D, @ref BasicTranslationTransformation2D @see @ref TranslationTransformation3D, @ref BasicTranslationTransformation2D
*/ */
#ifdef DOXYGEN_GENERATING_OUTPUT #ifdef DOXYGEN_GENERATING_OUTPUT
@ -171,18 +160,13 @@ template<class T, class TranslationType = T>
template<class T, class TranslationType> template<class T, class TranslationType>
#endif #endif
using BasicTranslationTransformation3D = TranslationTransformation<3, T, TranslationType>; using BasicTranslationTransformation3D = TranslationTransformation<3, T, TranslationType>;
#endif
/** /**
@brief Base transformation for three-dimensional float scenes supporting translation @brief Base transformation for three-dimensional float scenes supporting translation
@see @ref TranslationTransformation2D @see @ref TranslationTransformation2D
*/ */
#ifndef CORRADE_GCC46_COMPATIBILITY
typedef BasicTranslationTransformation3D<Float> TranslationTransformation3D; typedef BasicTranslationTransformation3D<Float> TranslationTransformation3D;
#else
typedef TranslationTransformation<3, Float> TranslationTransformation3D;
#endif
namespace Implementation { namespace Implementation {

1
src/Magnum/Shapes/shapeImplementation.h

@ -26,7 +26,6 @@
*/ */
#include <utility> #include <utility>
#include <Corrade/compatibility.h>
#include <Corrade/Utility/Assert.h> #include <Corrade/Utility/Assert.h>
#include "Magnum/DimensionTraits.h" #include "Magnum/DimensionTraits.h"

1
src/Magnum/Test/AbstractOpenGLTester.h

@ -26,7 +26,6 @@
*/ */
#include <Corrade/TestSuite/Tester.h> #include <Corrade/TestSuite/Tester.h>
#include <Corrade/compatibility.h>
#include "Magnum/Context.h" #include "Magnum/Context.h"
#include "Magnum/Extensions.h" #include "Magnum/Extensions.h"

3
src/Magnum/Test/AbstractQueryGLTest.cpp

@ -65,10 +65,7 @@ void AbstractQueryGLTest::construct() {
void AbstractQueryGLTest::constructCopy() { void AbstractQueryGLTest::constructCopy() {
CORRADE_VERIFY(!(std::is_constructible<SampleQuery, const SampleQuery&>{})); CORRADE_VERIFY(!(std::is_constructible<SampleQuery, const SampleQuery&>{}));
/* GCC 4.6 doesn't have std::is_assignable */
#ifndef CORRADE_GCC46_COMPATIBILITY
CORRADE_VERIFY(!(std::is_assignable<SampleQuery, const SampleQuery&>{})); CORRADE_VERIFY(!(std::is_assignable<SampleQuery, const SampleQuery&>{}));
#endif
} }
void AbstractQueryGLTest::constructMove() { void AbstractQueryGLTest::constructMove() {

3
src/Magnum/Test/AbstractShaderProgramGLTest.cpp

@ -96,10 +96,7 @@ void AbstractShaderProgramGLTest::construct() {
void AbstractShaderProgramGLTest::constructCopy() { void AbstractShaderProgramGLTest::constructCopy() {
CORRADE_VERIFY(!(std::is_constructible<DummyShader, const DummyShader&>{})); CORRADE_VERIFY(!(std::is_constructible<DummyShader, const DummyShader&>{}));
/* GCC 4.6 doesn't have std::is_assignable */
#ifndef CORRADE_GCC46_COMPATIBILITY
CORRADE_VERIFY(!(std::is_assignable<DummyShader, const DummyShader&>{})); CORRADE_VERIFY(!(std::is_assignable<DummyShader, const DummyShader&>{}));
#endif
} }
void AbstractShaderProgramGLTest::constructMove() { void AbstractShaderProgramGLTest::constructMove() {

3
src/Magnum/Test/AbstractTextureGLTest.cpp

@ -62,10 +62,7 @@ void AbstractTextureGLTest::construct() {
void AbstractTextureGLTest::constructCopy() { void AbstractTextureGLTest::constructCopy() {
CORRADE_VERIFY(!(std::is_constructible<Texture2D, const Texture2D&>{})); CORRADE_VERIFY(!(std::is_constructible<Texture2D, const Texture2D&>{}));
/* GCC 4.6 doesn't have std::is_assignable */
#ifndef CORRADE_GCC46_COMPATIBILITY
CORRADE_VERIFY(!(std::is_assignable<Texture2D, const Texture2D&>{})); CORRADE_VERIFY(!(std::is_assignable<Texture2D, const Texture2D&>{}));
#endif
} }
void AbstractTextureGLTest::constructMove() { void AbstractTextureGLTest::constructMove() {

4
src/Magnum/Test/ArrayTest.cpp

@ -52,11 +52,7 @@ void ArrayTest::construct() {
constexpr Array<3, Int> a = {5, 6, 7}; constexpr Array<3, Int> a = {5, 6, 7};
CORRADE_COMPARE(a, (Array<3, Int>(5, 6, 7))); CORRADE_COMPARE(a, (Array<3, Int>(5, 6, 7)));
#ifndef CORRADE_GCC46_COMPATIBILITY
constexpr Array<3, Int> a2 = 5; constexpr Array<3, Int> a2 = 5;
#else
Array<3, Int> a2 = 5; /* Not constexpr under GCC < 4.7 */
#endif
CORRADE_COMPARE(a2, (Array<3, Int>(5, 5, 5))); CORRADE_COMPARE(a2, (Array<3, Int>(5, 5, 5)));
constexpr Array1D b = 5; constexpr Array1D b = 5;

3
src/Magnum/Test/BufferGLTest.cpp

@ -87,10 +87,7 @@ void BufferGLTest::construct() {
void BufferGLTest::constructCopy() { void BufferGLTest::constructCopy() {
CORRADE_VERIFY(!(std::is_constructible<Buffer, const Buffer&>{})); CORRADE_VERIFY(!(std::is_constructible<Buffer, const Buffer&>{}));
/* GCC 4.6 doesn't have std::is_assignable */
#ifndef CORRADE_GCC46_COMPATIBILITY
CORRADE_VERIFY(!(std::is_assignable<Buffer, const Buffer&>{})); CORRADE_VERIFY(!(std::is_assignable<Buffer, const Buffer&>{}));
#endif
} }
void BufferGLTest::constructMove() { void BufferGLTest::constructMove() {

3
src/Magnum/Test/BufferImageGLTest.cpp

@ -74,10 +74,7 @@ void BufferImageTest::construct() {
void BufferImageTest::constructCopy() { void BufferImageTest::constructCopy() {
CORRADE_VERIFY(!(std::is_constructible<BufferImage2D, const BufferImage2D&>{})); CORRADE_VERIFY(!(std::is_constructible<BufferImage2D, const BufferImage2D&>{}));
/* GCC 4.6 doesn't have std::is_assignable */
#ifndef CORRADE_GCC46_COMPATIBILITY
CORRADE_VERIFY(!(std::is_assignable<BufferImage2D, const BufferImage2D&>{})); CORRADE_VERIFY(!(std::is_assignable<BufferImage2D, const BufferImage2D&>{}));
#endif
} }
void BufferImageTest::constructMove() { void BufferImageTest::constructMove() {

15
src/Magnum/Test/ColorTest.cpp

@ -115,10 +115,7 @@ void ColorTest::constructDefault() {
} }
void ColorTest::constructOneValue() { void ColorTest::constructOneValue() {
#ifndef CORRADE_GCC46_COMPATIBILITY constexpr Color3 a(0.25f);
constexpr /* Not constexpr under GCC < 4.7 */
#endif
Color3 a(0.25f);
CORRADE_COMPARE(a, Color3(0.25f, 0.25f, 0.25f)); CORRADE_COMPARE(a, Color3(0.25f, 0.25f, 0.25f));
constexpr Color4 b(0.25f, 0.5f); constexpr Color4 b(0.25f, 0.5f);
@ -151,17 +148,11 @@ void ColorTest::constructParts() {
void ColorTest::constructConversion() { void ColorTest::constructConversion() {
constexpr Color3 a(10.1f, 12.5f, 0.75f); constexpr Color3 a(10.1f, 12.5f, 0.75f);
#ifndef CORRADE_GCC46_COMPATIBILITY constexpr Color3ub b(a);
constexpr /* Not constexpr under GCC < 4.7 */
#endif
Color3ub b(a);
CORRADE_COMPARE(b, Color3ub(10, 12, 0)); CORRADE_COMPARE(b, Color3ub(10, 12, 0));
constexpr Color4 c(10.1f, 12.5f, 0.75f, 5.25f); constexpr Color4 c(10.1f, 12.5f, 0.75f, 5.25f);
#ifndef CORRADE_GCC46_COMPATIBILITY constexpr Color4ub d(c);
constexpr /* Not constexpr under GCC < 4.7 */
#endif
Color4ub d(c);
CORRADE_COMPARE(d, Color4ub(10, 12, 0, 5)); CORRADE_COMPARE(d, Color4ub(10, 12, 0, 5));
/* Implicit conversion is not allowed */ /* Implicit conversion is not allowed */

3
src/Magnum/Test/FramebufferGLTest.cpp

@ -156,10 +156,7 @@ void FramebufferGLTest::construct() {
void FramebufferGLTest::constructCopy() { void FramebufferGLTest::constructCopy() {
CORRADE_VERIFY(!(std::is_constructible<Framebuffer, const Framebuffer&>{})); CORRADE_VERIFY(!(std::is_constructible<Framebuffer, const Framebuffer&>{}));
/* GCC 4.6 doesn't have std::is_assignable */
#ifndef CORRADE_GCC46_COMPATIBILITY
CORRADE_VERIFY(!(std::is_assignable<Framebuffer, const Framebuffer&>{})); CORRADE_VERIFY(!(std::is_assignable<Framebuffer, const Framebuffer&>{}));
#endif
} }
void FramebufferGLTest::constructMove() { void FramebufferGLTest::constructMove() {

3
src/Magnum/Test/ImageTest.cpp

@ -65,10 +65,7 @@ void ImageTest::construct() {
void ImageTest::constructCopy() { void ImageTest::constructCopy() {
CORRADE_VERIFY(!(std::is_constructible<Image2D, const Image2D&>{})); CORRADE_VERIFY(!(std::is_constructible<Image2D, const Image2D&>{}));
/* GCC 4.6 doesn't have std::is_assignable */
#ifndef CORRADE_GCC46_COMPATIBILITY
CORRADE_VERIFY(!(std::is_assignable<Image2D, const Image2D&>{})); CORRADE_VERIFY(!(std::is_assignable<Image2D, const Image2D&>{}));
#endif
} }
void ImageTest::constructMove() { void ImageTest::constructMove() {

3
src/Magnum/Test/MeshGLTest.cpp

@ -247,10 +247,7 @@ void MeshGLTest::construct() {
void MeshGLTest::constructCopy() { void MeshGLTest::constructCopy() {
CORRADE_VERIFY(!(std::is_constructible<Mesh, const Mesh&>{})); CORRADE_VERIFY(!(std::is_constructible<Mesh, const Mesh&>{}));
/* GCC 4.6 doesn't have std::is_assignable */
#ifndef CORRADE_GCC46_COMPATIBILITY
CORRADE_VERIFY(!(std::is_assignable<Mesh, const Mesh&>{})); CORRADE_VERIFY(!(std::is_assignable<Mesh, const Mesh&>{}));
#endif
} }
void MeshGLTest::constructMove() { void MeshGLTest::constructMove() {

3
src/Magnum/Test/RenderbufferGLTest.cpp

@ -75,10 +75,7 @@ void RenderbufferGLTest::construct() {
void RenderbufferGLTest::constructCopy() { void RenderbufferGLTest::constructCopy() {
CORRADE_VERIFY(!(std::is_constructible<Renderbuffer, const Renderbuffer&>{})); CORRADE_VERIFY(!(std::is_constructible<Renderbuffer, const Renderbuffer&>{}));
/* GCC 4.6 doesn't have std::is_assignable */
#ifndef CORRADE_GCC46_COMPATIBILITY
CORRADE_VERIFY(!(std::is_assignable<Renderbuffer, const Renderbuffer&>{})); CORRADE_VERIFY(!(std::is_assignable<Renderbuffer, const Renderbuffer&>{}));
#endif
} }
void RenderbufferGLTest::constructMove() { void RenderbufferGLTest::constructMove() {

1
src/Magnum/Test/ResourceManagerTest.cpp

@ -24,7 +24,6 @@
*/ */
#include <sstream> #include <sstream>
#include <Corrade/compatibility.h>
#include <Corrade/TestSuite/Tester.h> #include <Corrade/TestSuite/Tester.h>
#include "Magnum/AbstractResourceLoader.h" #include "Magnum/AbstractResourceLoader.h"

3
src/Magnum/Test/ShaderGLTest.cpp

@ -91,10 +91,7 @@ void ShaderGLTest::constructNoVersion() {
void ShaderGLTest::constructCopy() { void ShaderGLTest::constructCopy() {
CORRADE_VERIFY(!(std::is_constructible<Shader, const Shader&>{})); CORRADE_VERIFY(!(std::is_constructible<Shader, const Shader&>{}));
/* GCC 4.6 doesn't have std::is_assignable */
#ifndef CORRADE_GCC46_COMPATIBILITY
CORRADE_VERIFY(!(std::is_assignable<Shader, const Shader&>{})); CORRADE_VERIFY(!(std::is_assignable<Shader, const Shader&>{}));
#endif
} }
void ShaderGLTest::constructMove() { void ShaderGLTest::constructMove() {

3
src/Magnum/Trade/Test/ImageDataTest.cpp

@ -63,10 +63,7 @@ void ImageDataTest::construct() {
void ImageDataTest::constructCopy() { void ImageDataTest::constructCopy() {
CORRADE_VERIFY(!(std::is_constructible<Trade::ImageData2D, const Trade::ImageData2D&>{})); CORRADE_VERIFY(!(std::is_constructible<Trade::ImageData2D, const Trade::ImageData2D&>{}));
/* GCC 4.6 doesn't have std::is_assignable */
#ifndef CORRADE_GCC46_COMPATIBILITY
CORRADE_VERIFY(!(std::is_assignable<Trade::ImageData2D, const Trade::ImageData2D&>{})); CORRADE_VERIFY(!(std::is_assignable<Trade::ImageData2D, const Trade::ImageData2D&>{}));
#endif
} }
void ImageDataTest::constructMove() { void ImageDataTest::constructMove() {

8
src/MagnumPlugins/MagnumFont/MagnumFont.cpp

@ -37,10 +37,6 @@
namespace Magnum { namespace Text { namespace Magnum { namespace Text {
struct MagnumFont::Data { struct MagnumFont::Data {
#ifdef CORRADE_GCC46_COMPATIBILITY
explicit Data(Utility::Configuration&& conf, Trade::ImageData2D&& image, std::unordered_map<char32_t, UnsignedInt>&& glyphId, std::vector<Vector2>&& glyphAdvance): conf(std::move(conf)), image(std::move(image)), glyphId(std::move(glyphId)), glyphAdvance(std::move(glyphAdvance)) {}
#endif
Utility::Configuration conf; Utility::Configuration conf;
Trade::ImageData2D image; Trade::ImageData2D image;
std::unordered_map<char32_t, UnsignedInt> glyphId; std::unordered_map<char32_t, UnsignedInt> glyphId;
@ -162,11 +158,7 @@ std::pair<Float, Float> MagnumFont::openInternal(Utility::Configuration&& conf,
for(const Utility::ConfigurationGroup* const c: chars) { for(const Utility::ConfigurationGroup* const c: chars) {
const UnsignedInt glyphId = c->value<UnsignedInt>("glyph"); const UnsignedInt glyphId = c->value<UnsignedInt>("glyph");
CORRADE_INTERNAL_ASSERT(glyphId < _opened->glyphAdvance.size()); CORRADE_INTERNAL_ASSERT(glyphId < _opened->glyphAdvance.size());
#ifndef CORRADE_GCC46_COMPATIBILITY
_opened->glyphId.emplace(c->value<char32_t>("unicode"), glyphId); _opened->glyphId.emplace(c->value<char32_t>("unicode"), glyphId);
#else
_opened->glyphId.insert({c->value<char32_t>("unicode"), glyphId});
#endif
} }
return {_opened->conf.value<Float>("fontSize"), _opened->conf.value<Float>("lineHeight")}; return {_opened->conf.value<Float>("fontSize"), _opened->conf.value<Float>("lineHeight")};

8
src/MagnumPlugins/MagnumFontConverter/MagnumFontConverter.cpp

@ -64,17 +64,9 @@ std::vector<std::pair<std::string, Containers::Array<unsigned char>>> MagnumFont
should stay at position 0 */ should stay at position 0 */
std::unordered_map<UnsignedInt, UnsignedInt> glyphIdMap; std::unordered_map<UnsignedInt, UnsignedInt> glyphIdMap;
glyphIdMap.reserve(cache.glyphCount()); glyphIdMap.reserve(cache.glyphCount());
#ifndef CORRADE_GCC46_COMPATIBILITY
glyphIdMap.emplace(0, 0); glyphIdMap.emplace(0, 0);
#else
glyphIdMap.insert({0, 0});
#endif
for(const std::pair<UnsignedInt, std::pair<Vector2i, Range2Di>>& glyph: cache) for(const std::pair<UnsignedInt, std::pair<Vector2i, Range2Di>>& glyph: cache)
#ifndef CORRADE_GCC46_COMPATIBILITY
glyphIdMap.emplace(glyph.first, glyphIdMap.size()); glyphIdMap.emplace(glyph.first, glyphIdMap.size());
#else
glyphIdMap.insert({glyph.first, glyphIdMap.size()});
#endif
/** @todo Save only glyphs contained in @p characters */ /** @todo Save only glyphs contained in @p characters */

8
src/MagnumPlugins/ObjImporter/ObjImporter.cpp

@ -175,11 +175,7 @@ void ObjImporter::parseMeshNames() {
/* Update its name and add it to name map */ /* Update its name and add it to name map */
if(!name.empty()) if(!name.empty())
#ifndef CORRADE_GCC46_COMPATIBILITY
_file->meshesForName.emplace(name, _file->meshes.size() - 1); _file->meshesForName.emplace(name, _file->meshes.size() - 1);
#else
_file->meshesForName.insert({name, _file->meshes.size() - 1});
#endif
_file->meshNames.back() = std::move(name); _file->meshNames.back() = std::move(name);
/* Update its begin offset to be more precise */ /* Update its begin offset to be more precise */
@ -193,11 +189,7 @@ void ObjImporter::parseMeshNames() {
/* Save name and offset of the new one. The end offset will be /* Save name and offset of the new one. The end offset will be
updated later. */ updated later. */
if(!name.empty()) if(!name.empty())
#ifndef CORRADE_GCC46_COMPATIBILITY
_file->meshesForName.emplace(name, _file->meshes.size()); _file->meshesForName.emplace(name, _file->meshes.size());
#else
_file->meshesForName.insert({name, _file->meshes.size()});
#endif
_file->meshNames.emplace_back(std::move(name)); _file->meshNames.emplace_back(std::move(name));
_file->meshes.emplace_back(_file->in->tellg(), 0, positionIndexOffset, textureCoordinateIndexOffset, normalIndexOffset); _file->meshes.emplace_back(_file->in->tellg(), 0, positionIndexOffset, textureCoordinateIndexOffset, normalIndexOffset);
} }

Loading…
Cancel
Save