From 761885683c884ea2eb7bb28ce728e4d16dd6a7c8 Mon Sep 17 00:00:00 2001 From: christophe Date: Sun, 19 Oct 2025 21:26:37 +0200 Subject: [PATCH] Removed initializer list C++98 workarounds --- glm/detail/qualifier.hpp | 30 ++-- glm/detail/setup.hpp | 153 ++---------------- glm/detail/type_mat2x2.hpp | 21 +-- glm/detail/type_mat2x2.inl | 178 ++++----------------- glm/detail/type_mat2x3.hpp | 3 + glm/detail/type_mat2x3.inl | 176 ++++---------------- glm/detail/type_mat2x4.hpp | 21 +-- glm/detail/type_mat2x4.inl | 182 ++++----------------- glm/detail/type_mat3x2.hpp | 3 + glm/detail/type_mat3x2.inl | 194 ++++------------------ glm/detail/type_mat3x3.hpp | 25 +-- glm/detail/type_mat3x3.inl | 194 ++++------------------ glm/detail/type_mat3x4.hpp | 21 +-- glm/detail/type_mat3x4.inl | 206 +++++------------------- glm/detail/type_mat4x2.hpp | 21 +-- glm/detail/type_mat4x2.inl | 210 ++++-------------------- glm/detail/type_mat4x3.hpp | 17 +- glm/detail/type_mat4x3.inl | 210 ++++-------------------- glm/detail/type_mat4x4.hpp | 24 +-- glm/detail/type_mat4x4.inl | 212 ++++--------------------- glm/detail/type_quat.hpp | 4 +- glm/detail/type_quat.inl | 31 +--- glm/detail/type_vec1.hpp | 4 +- glm/detail/type_vec1.inl | 22 +-- glm/detail/type_vec2.hpp | 4 +- glm/detail/type_vec2.inl | 23 +-- glm/detail/type_vec3.hpp | 4 +- glm/detail/type_vec3.inl | 24 +-- glm/detail/type_vec4.hpp | 4 +- glm/detail/type_vec4.inl | 25 +-- glm/glm.cppm | 5 +- glm/gtx/dual_quaternion.hpp | 6 +- glm/gtx/dual_quaternion.inl | 22 +-- glm/gtx/structured_bindings.hpp | 2 - glm/gtx/structured_bindings.inl | 2 - test/core/core_cpp_constexpr.cpp | 18 +-- test/core/core_cpp_defaulted_ctor.cpp | 12 +- test/core/core_func_common.cpp | 2 - test/core/core_type_ctor.cpp | 28 ---- test/core/core_type_mat2x2.cpp | 2 - test/core/core_type_mat2x3.cpp | 2 - test/core/core_type_mat2x4.cpp | 2 - test/core/core_type_mat3x2.cpp | 2 - test/core/core_type_mat3x3.cpp | 2 - test/core/core_type_mat3x4.cpp | 2 - test/core/core_type_mat4x2.cpp | 2 - test/core/core_type_mat4x3.cpp | 2 - test/core/core_type_mat4x4.cpp | 2 - test/core/core_type_vec1.cpp | 2 - test/core/core_type_vec2.cpp | 2 - test/core/core_type_vec3.cpp | 2 - test/core/core_type_vec4.cpp | 2 - test/ext/ext_quaternion_type.cpp | 2 - test/ext/ext_scalar_relational.cpp | 12 +- test/ext/ext_vec1.cpp | 2 - test/ext/ext_vector_bool1.cpp | 4 +- test/ext/ext_vector_iec559.cpp | 4 +- test/ext/ext_vector_integer_sized.cpp | 10 +- test/ext/ext_vector_relational.cpp | 4 +- test/gtc/gtc_type_aligned.cpp | 58 +++---- test/gtx/gtx_scalar_multiplication.cpp | 2 +- 61 files changed, 496 insertions(+), 1971 deletions(-) diff --git a/glm/detail/qualifier.hpp b/glm/detail/qualifier.hpp index aa6089920..d05e03345 100644 --- a/glm/detail/qualifier.hpp +++ b/glm/detail/qualifier.hpp @@ -36,22 +36,20 @@ namespace glm template struct mat; template struct qua; -# if GLM_HAS_TEMPLATE_ALIASES - template using tvec1 = vec<1, T, Q>; - template using tvec2 = vec<2, T, Q>; - template using tvec3 = vec<3, T, Q>; - template using tvec4 = vec<4, T, Q>; - template using tmat2x2 = mat<2, 2, T, Q>; - template using tmat2x3 = mat<2, 3, T, Q>; - template using tmat2x4 = mat<2, 4, T, Q>; - template using tmat3x2 = mat<3, 2, T, Q>; - template using tmat3x3 = mat<3, 3, T, Q>; - template using tmat3x4 = mat<3, 4, T, Q>; - template using tmat4x2 = mat<4, 2, T, Q>; - template using tmat4x3 = mat<4, 3, T, Q>; - template using tmat4x4 = mat<4, 4, T, Q>; - template using tquat = qua; -# endif + template using tvec1 = vec<1, T, Q>; + template using tvec2 = vec<2, T, Q>; + template using tvec3 = vec<3, T, Q>; + template using tvec4 = vec<4, T, Q>; + template using tmat2x2 = mat<2, 2, T, Q>; + template using tmat2x3 = mat<2, 3, T, Q>; + template using tmat2x4 = mat<2, 4, T, Q>; + template using tmat3x2 = mat<3, 2, T, Q>; + template using tmat3x3 = mat<3, 3, T, Q>; + template using tmat3x4 = mat<3, 4, T, Q>; + template using tmat4x2 = mat<4, 2, T, Q>; + template using tmat4x3 = mat<4, 3, T, Q>; + template using tmat4x4 = mat<4, 4, T, Q>; + template using tquat = qua; namespace detail { diff --git a/glm/detail/setup.hpp b/glm/detail/setup.hpp index 49b519fd3..fa57ba99c 100644 --- a/glm/detail/setup.hpp +++ b/glm/detail/setup.hpp @@ -144,88 +144,9 @@ /////////////////////////////////////////////////////////////////////////////////// // Has of C++ features -// N2672 Initializer lists http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2672.htm -#if GLM_COMPILER & GLM_COMPILER_CLANG -# define GLM_HAS_INITIALIZER_LISTS __has_feature(cxx_generalized_initializers) -#elif GLM_LANG & GLM_LANG_CXX11_FLAG -# define GLM_HAS_INITIALIZER_LISTS 1 -#else -# define GLM_HAS_INITIALIZER_LISTS ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ - ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC15)) || \ - ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL14)) || \ - ((GLM_COMPILER & GLM_COMPILER_CUDA)) || \ - ((GLM_COMPILER & GLM_COMPILER_HIP)))) -#endif +#define GLM_HAS_INITIALIZER_LISTS 1 -// N2544 Unrestricted unions http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2544.pdf -#if GLM_COMPILER & GLM_COMPILER_CLANG -# define GLM_HAS_UNRESTRICTED_UNIONS __has_feature(cxx_unrestricted_unions) -#elif GLM_LANG & GLM_LANG_CXX11_FLAG -# define GLM_HAS_UNRESTRICTED_UNIONS 1 -#else -# define GLM_HAS_UNRESTRICTED_UNIONS (GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ - (GLM_COMPILER & GLM_COMPILER_VC) || \ - ((GLM_COMPILER & GLM_COMPILER_CUDA)) || \ - ((GLM_COMPILER & GLM_COMPILER_HIP))) -#endif - -// N2346 -#if GLM_COMPILER & GLM_COMPILER_CLANG -# define GLM_HAS_DEFAULTED_FUNCTIONS __has_feature(cxx_defaulted_functions) -#elif GLM_LANG & GLM_LANG_CXX11_FLAG -# define GLM_HAS_DEFAULTED_FUNCTIONS 1 -#else -# define GLM_HAS_DEFAULTED_FUNCTIONS ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ - ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12)) || \ - ((GLM_COMPILER & GLM_COMPILER_INTEL)) || \ - (GLM_COMPILER & GLM_COMPILER_CUDA)) || \ - ((GLM_COMPILER & GLM_COMPILER_HIP))) -#endif - -// N2118 -#if GLM_COMPILER & GLM_COMPILER_CLANG -# define GLM_HAS_RVALUE_REFERENCES __has_feature(cxx_rvalue_references) -#elif GLM_LANG & GLM_LANG_CXX11_FLAG -# define GLM_HAS_RVALUE_REFERENCES 1 -#else -# define GLM_HAS_RVALUE_REFERENCES ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ - ((GLM_COMPILER & GLM_COMPILER_VC)) || \ - ((GLM_COMPILER & GLM_COMPILER_CUDA)) || \ - ((GLM_COMPILER & GLM_COMPILER_HIP)))) -#endif - -// N2258 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2258.pdf -#if GLM_COMPILER & GLM_COMPILER_CLANG -# define GLM_HAS_TEMPLATE_ALIASES __has_feature(cxx_alias_templates) -#elif GLM_LANG & GLM_LANG_CXX11_FLAG -# define GLM_HAS_TEMPLATE_ALIASES 1 -#else -# define GLM_HAS_TEMPLATE_ALIASES ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ - ((GLM_COMPILER & GLM_COMPILER_INTEL)) || \ - ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12)) || \ - ((GLM_COMPILER & GLM_COMPILER_CUDA)) || \ - ((GLM_COMPILER & GLM_COMPILER_HIP)))) -#endif - -// N2235 Generalized Constant Expressions http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2235.pdf -// N3652 Extended Constant Expressions http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3652.html -#if (GLM_ARCH & GLM_ARCH_SIMD_BIT) // Compiler SIMD intrinsics don't support constexpr... -# define GLM_HAS_CONSTEXPR 0 -#elif (GLM_COMPILER & GLM_COMPILER_CLANG) -# define GLM_HAS_CONSTEXPR __has_feature(cxx_relaxed_constexpr) -#elif (GLM_LANG & GLM_LANG_CXX14_FLAG) -# define GLM_HAS_CONSTEXPR 1 -#else -# define GLM_HAS_CONSTEXPR ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && GLM_HAS_INITIALIZER_LISTS && (\ - ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL17)) || \ - ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC15)))) -#endif - -#if GLM_HAS_CONSTEXPR -# define GLM_CONSTEXPR constexpr -#else -# define GLM_CONSTEXPR -#endif +#define GLM_CONSTEXPR constexpr // [nodiscard] #if GLM_LANG & GLM_LANG_CXX17_FLAG @@ -339,13 +260,9 @@ #define GLM_FUNC_QUALIFIER GLM_CUDA_FUNC_DEF GLM_INLINE // Do not use CUDA function qualifiers on CUDA compiler when functions are made default -#if GLM_HAS_DEFAULTED_FUNCTIONS -# define GLM_DEFAULTED_FUNC_DECL -# define GLM_DEFAULTED_FUNC_QUALIFIER GLM_INLINE -#else -# define GLM_DEFAULTED_FUNC_DECL GLM_FUNC_DISCARD_DECL -# define GLM_DEFAULTED_FUNC_QUALIFIER GLM_FUNC_QUALIFIER -#endif//GLM_HAS_DEFAULTED_FUNCTIONS +#define GLM_DEFAULTED_FUNC_DECL +#define GLM_DEFAULTED_FUNC_QUALIFIER GLM_INLINE + #if !defined(GLM_FORCE_CTOR_INIT) # define GLM_DEFAULTED_DEFAULT_CTOR_DECL # define GLM_DEFAULTED_DEFAULT_CTOR_QUALIFIER GLM_DEFAULTED_FUNC_QUALIFIER @@ -483,37 +400,11 @@ namespace glm # endif }//namespace glm -/////////////////////////////////////////////////////////////////////////////////// -// constexpr - -#if GLM_HAS_CONSTEXPR -# define GLM_CONFIG_CONSTEXP GLM_ENABLE - - namespace glm - { - template - constexpr std::size_t countof(T const (&)[N]) - { - return N; - } - }//namespace glm -# define GLM_COUNTOF(arr) glm::countof(arr) -#elif defined(_MSC_VER) -# define GLM_CONFIG_CONSTEXP GLM_DISABLE - -# define GLM_COUNTOF(arr) _countof(arr) -#else -# define GLM_CONFIG_CONSTEXP GLM_DISABLE - -# define GLM_COUNTOF(arr) sizeof(arr) / sizeof(arr[0]) -#endif - /////////////////////////////////////////////////////////////////////////////////// // uint #include - namespace glm{ namespace detail { @@ -594,21 +485,6 @@ namespace detail # define GLM_CONFIG_XYZW_ONLY GLM_DISABLE #endif -/////////////////////////////////////////////////////////////////////////////////// -// Configure the use of defaulted initialized types - -#define GLM_CTOR_INIT_DISABLE 0 -#define GLM_CTOR_INITIALIZER_LIST 1 -#define GLM_CTOR_INITIALISATION 2 - -#if defined(GLM_FORCE_CTOR_INIT) && GLM_HAS_INITIALIZER_LISTS -# define GLM_CONFIG_CTOR_INIT GLM_CTOR_INITIALIZER_LIST -#elif defined(GLM_FORCE_CTOR_INIT) && !GLM_HAS_INITIALIZER_LISTS -# define GLM_CONFIG_CTOR_INIT GLM_CTOR_INITIALISATION -#else -# define GLM_CONFIG_CTOR_INIT GLM_CTOR_INIT_DISABLE -#endif - /////////////////////////////////////////////////////////////////////////////////// // Use SIMD instruction sets @@ -619,21 +495,22 @@ namespace detail #endif /////////////////////////////////////////////////////////////////////////////////// -// Configure the use of defaulted function +// Configure the use of defaulted initialized types -#if GLM_HAS_DEFAULTED_FUNCTIONS -# define GLM_CONFIG_DEFAULTED_FUNCTIONS GLM_ENABLE -# define GLM_DEFAULT = default +#if defined(GLM_FORCE_CTOR_INIT) +# define GLM_CONFIG_CTOR_INIT GLM_ENABLE #else -# define GLM_CONFIG_DEFAULTED_FUNCTIONS GLM_DISABLE -# define GLM_DEFAULT +# define GLM_CONFIG_CTOR_INIT GLM_DISABLE #endif -#if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INIT_DISABLE && GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_ENABLE -# define GLM_CONFIG_DEFAULTED_DEFAULT_CTOR GLM_ENABLE +/////////////////////////////////////////////////////////////////////////////////// +// Configure the use of defaulted function + +#define GLM_DEFAULT = default + +#if GLM_CONFIG_CTOR_INIT == GLM_DISABLE # define GLM_DEFAULT_CTOR GLM_DEFAULT #else -# define GLM_CONFIG_DEFAULTED_DEFAULT_CTOR GLM_DISABLE # define GLM_DEFAULT_CTOR #endif diff --git a/glm/detail/type_mat2x2.hpp b/glm/detail/type_mat2x2.hpp index 82e9f66cd..55d789c23 100644 --- a/glm/detail/type_mat2x2.hpp +++ b/glm/detail/type_mat2x2.hpp @@ -33,6 +33,7 @@ namespace glm // -- Constructors -- GLM_DEFAULTED_DEFAULT_CTOR_DECL GLM_CONSTEXPR mat() GLM_DEFAULT_CTOR; + GLM_CTOR_DECL mat(mat<2, 2, T, Q> const& m) = default; template GLM_CTOR_DECL mat(mat<2, 2, T, P> const& m); @@ -72,24 +73,26 @@ namespace glm // -- Unary arithmetic operators -- + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 2, T, Q>& operator=(mat<2, 2, T, Q> const& m) = default; + template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 2, T, Q> & operator=(mat<2, 2, U, Q> const& m); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 2, T, Q>& operator=(mat<2, 2, U, Q> const& m); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 2, T, Q> & operator+=(U s); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 2, T, Q>& operator+=(U s); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 2, T, Q> & operator+=(mat<2, 2, U, Q> const& m); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 2, T, Q>& operator+=(mat<2, 2, U, Q> const& m); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 2, T, Q> & operator-=(U s); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 2, T, Q>& operator-=(U s); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 2, T, Q> & operator-=(mat<2, 2, U, Q> const& m); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 2, T, Q>& operator-=(mat<2, 2, U, Q> const& m); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 2, T, Q> & operator*=(U s); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 2, T, Q>& operator*=(U s); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 2, T, Q> & operator*=(mat<2, 2, U, Q> const& m); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 2, T, Q>& operator*=(mat<2, 2, U, Q> const& m); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 2, T, Q> & operator/=(U s); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 2, T, Q>& operator/=(U s); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 2, T, Q> & operator/=(mat<2, 2, U, Q> const& m); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 2, T, Q>& operator/=(mat<2, 2, U, Q> const& m); // -- Increment and decrement operators -- diff --git a/glm/detail/type_mat2x2.inl b/glm/detail/type_mat2x2.inl index afb2b31e5..d402589e4 100644 --- a/glm/detail/type_mat2x2.inl +++ b/glm/detail/type_mat2x2.inl @@ -4,44 +4,23 @@ namespace glm { // -- Constructors -- -# if GLM_CONFIG_DEFAULTED_DEFAULT_CTOR == GLM_DISABLE +# if GLM_CONFIG_CTOR_INIT == GLM_ENABLE template GLM_DEFAULTED_DEFAULT_CTOR_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat() -# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST - : value{col_type(1, 0), col_type(0, 1)} -# endif - { -# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALISATION - this->value[0] = col_type(1, 0); - this->value[1] = col_type(0, 1); -# endif - } + : value{col_type(1, 0), col_type(0, 1)} + {} # endif template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat(mat<2, 2, T, P> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = m[0]; - this->value[1] = m[1]; -# endif - } + : value{col_type(m[0]), col_type(m[1])} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat(T scalar) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(scalar, 0), col_type(0, scalar)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(scalar, 0); - this->value[1] = col_type(0, scalar); -# endif - } + : value{col_type(scalar, 0), col_type(0, scalar)} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat @@ -49,27 +28,13 @@ namespace glm T const& x0, T const& y0, T const& x1, T const& y1 ) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(x0, y0), col_type(x1, y1)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(x0, y0); - this->value[1] = col_type(x1, y1); -# endif - } + : value{col_type(x0, y0), col_type(x1, y1)} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat(col_type const& v0, col_type const& v1) -# if GLM_HAS_INITIALIZER_LISTS - : value{v0, v1} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = v0; - this->value[1] = v1; -# endif - } + : value{v0, v1} + {} // -- Conversion constructors -- @@ -80,139 +45,62 @@ namespace glm X1 const& x1, Y1 const& y1, X2 const& x2, Y2 const& y2 ) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(static_cast(x1), value_type(y1)), col_type(static_cast(x2), value_type(y2)) } -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(static_cast(x1), value_type(y1)); - this->value[1] = col_type(static_cast(x2), value_type(y2)); -# endif - } + : value{col_type(static_cast(x1), value_type(y1)), col_type(static_cast(x2), value_type(y2)) } + {} template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat(vec<2, V1, Q> const& v1, vec<2, V2, Q> const& v2) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(v1), col_type(v2)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(v1); - this->value[1] = col_type(v2); -# endif - } + : value{col_type(v1), col_type(v2)} + {} // -- mat2x2 matrix conversions -- template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat(mat<2, 2, U, P> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); -# endif - } + : value{col_type(m[0]), col_type(m[1])} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat(mat<3, 3, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); -# endif - } + : value{col_type(m[0]), col_type(m[1])} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat(mat<4, 4, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); -# endif - } + : value{col_type(m[0]), col_type(m[1])} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat(mat<2, 3, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); -# endif - } + : value{col_type(m[0]), col_type(m[1])} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat(mat<3, 2, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); -# endif - } + : value{col_type(m[0]), col_type(m[1])} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat(mat<2, 4, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); -# endif - } + : value{col_type(m[0]), col_type(m[1])} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat(mat<4, 2, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); -# endif - } + : value{col_type(m[0]), col_type(m[1])} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat(mat<3, 4, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); -# endif - } + : value{col_type(m[0]), col_type(m[1])} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat(mat<4, 3, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); -# endif - } + : value{col_type(m[0]), col_type(m[1])} + {} // -- Accesses -- diff --git a/glm/detail/type_mat2x3.hpp b/glm/detail/type_mat2x3.hpp index b65d1c5c4..751a35ade 100644 --- a/glm/detail/type_mat2x3.hpp +++ b/glm/detail/type_mat2x3.hpp @@ -34,6 +34,7 @@ namespace glm // -- Constructors -- GLM_DEFAULTED_DEFAULT_CTOR_DECL GLM_CONSTEXPR mat() GLM_DEFAULT_CTOR; + GLM_CTOR_DECL mat(mat<2, 3, T, Q> const& m) = default; template GLM_CTOR_DECL mat(mat<2, 3, T, P> const& m); @@ -73,6 +74,8 @@ namespace glm // -- Unary arithmetic operators -- + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 3, T, Q>& operator=(mat<2, 3, T, Q> const& m) = default; + template GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 3, T, Q> & operator=(mat<2, 3, U, Q> const& m); template diff --git a/glm/detail/type_mat2x3.inl b/glm/detail/type_mat2x3.inl index c29666c3b..ba6152602 100644 --- a/glm/detail/type_mat2x3.inl +++ b/glm/detail/type_mat2x3.inl @@ -2,44 +2,23 @@ namespace glm { // -- Constructors -- -# if GLM_CONFIG_DEFAULTED_DEFAULT_CTOR == GLM_DISABLE +# if GLM_CONFIG_CTOR_INIT == GLM_ENABLE template GLM_DEFAULTED_DEFAULT_CTOR_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat() -# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST - : value{col_type(1, 0, 0), col_type(0, 1, 0)} -# endif - { -# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALISATION - this->value[0] = col_type(1, 0, 0); - this->value[1] = col_type(0, 1, 0); -# endif - } + : value{col_type(1, 0, 0), col_type(0, 1, 0)} + {} # endif template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat(mat<2, 3, T, P> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = m.value[0]; - this->value[1] = m.value[1]; -# endif - } + : value{col_type(m[0]), col_type(m[1])} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat(T scalar) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(scalar, 0, 0), col_type(0, scalar, 0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(scalar, 0, 0); - this->value[1] = col_type(0, scalar, 0); -# endif - } + : value{col_type(scalar, 0, 0), col_type(0, scalar, 0)} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat @@ -47,27 +26,13 @@ namespace glm T x0, T y0, T z0, T x1, T y1, T z1 ) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(x0, y0, z0), col_type(x1, y1, z1)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(x0, y0, z0); - this->value[1] = col_type(x1, y1, z1); -# endif - } + : value{col_type(x0, y0, z0), col_type(x1, y1, z1)} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat(col_type const& v0, col_type const& v1) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(v0), col_type(v1)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(v0); - this->value[1] = col_type(v1); -# endif - } + : value{col_type(v0), col_type(v1)} + {} // -- Conversion constructors -- @@ -80,139 +45,62 @@ namespace glm X1 x1, Y1 y1, Z1 z1, X2 x2, Y2 y2, Z2 z2 ) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(x1, y1, z1), col_type(x2, y2, z2)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(x1, y1, z1); - this->value[1] = col_type(x2, y2, z2); -# endif - } + : value{col_type(x1, y1, z1), col_type(x2, y2, z2)} + {} template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat(vec<3, V1, Q> const& v1, vec<3, V2, Q> const& v2) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(v1), col_type(v2)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(v1); - this->value[1] = col_type(v2); -# endif - } + : value{col_type(v1), col_type(v2)} + {} // -- Matrix conversions -- template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat(mat<2, 3, U, P> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); -# endif - } + : value{col_type(m[0]), col_type(m[1])} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat(mat<2, 2, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0], 0), col_type(m[1], 0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0], 0); - this->value[1] = col_type(m[1], 0); -# endif - } + : value{col_type(m[0], 0), col_type(m[1], 0)} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat(mat<3, 3, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); -# endif - } + : value{col_type(m[0]), col_type(m[1])} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat(mat<4, 4, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS : value{col_type(m[0]), col_type(m[1])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); -# endif - } + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat(mat<2, 4, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); -# endif - } + : value{col_type(m[0]), col_type(m[1])} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat(mat<3, 2, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0], 0), col_type(m[1], 0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0], 0); - this->value[1] = col_type(m[1], 0); -# endif - } + : value{col_type(m[0], 0), col_type(m[1], 0)} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat(mat<3, 4, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); -# endif - } + : value{col_type(m[0]), col_type(m[1])} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat(mat<4, 2, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0], 0), col_type(m[1], 0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0], 0); - this->value[1] = col_type(m[1], 0); -# endif - } + : value{col_type(m[0], 0), col_type(m[1], 0)} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat(mat<4, 3, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); -# endif - } + : value{col_type(m[0]), col_type(m[1])} + {} // -- Accesses -- diff --git a/glm/detail/type_mat2x4.hpp b/glm/detail/type_mat2x4.hpp index 7ca43e59a..a45f68d2e 100644 --- a/glm/detail/type_mat2x4.hpp +++ b/glm/detail/type_mat2x4.hpp @@ -34,6 +34,7 @@ namespace glm // -- Constructors -- GLM_DEFAULTED_DEFAULT_CTOR_DECL GLM_CONSTEXPR mat() GLM_DEFAULT_CTOR; + GLM_CTOR_DECL mat(mat<2, 4, T, Q> const& m) = default; template GLM_CTOR_DECL mat(mat<2, 4, T, P> const& m); @@ -75,25 +76,27 @@ namespace glm // -- Unary arithmetic operators -- + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 4, T, Q>& operator=(mat<2, 4, T, Q> const& m) = default; + template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 4, T, Q> & operator=(mat<2, 4, U, Q> const& m); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 4, T, Q>& operator=(mat<2, 4, U, Q> const& m); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 4, T, Q> & operator+=(U s); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 4, T, Q>& operator+=(U s); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 4, T, Q> & operator+=(mat<2, 4, U, Q> const& m); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 4, T, Q>& operator+=(mat<2, 4, U, Q> const& m); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 4, T, Q> & operator-=(U s); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 4, T, Q>& operator-=(U s); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 4, T, Q> & operator-=(mat<2, 4, U, Q> const& m); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 4, T, Q>& operator-=(mat<2, 4, U, Q> const& m); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 4, T, Q> & operator*=(U s); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 4, T, Q>& operator*=(U s); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 4, T, Q> & operator/=(U s); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 4, T, Q>& operator/=(U s); // -- Increment and decrement operators -- - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 4, T, Q> & operator++ (); - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 4, T, Q> & operator-- (); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 4, T, Q>& operator++ (); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<2, 4, T, Q>& operator-- (); GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 4, T, Q> operator++(int); GLM_FUNC_DECL GLM_CONSTEXPR mat<2, 4, T, Q> operator--(int); }; diff --git a/glm/detail/type_mat2x4.inl b/glm/detail/type_mat2x4.inl index bde07ced0..47f7d298b 100644 --- a/glm/detail/type_mat2x4.inl +++ b/glm/detail/type_mat2x4.inl @@ -2,44 +2,23 @@ namespace glm { // -- Constructors -- -# if GLM_CONFIG_DEFAULTED_DEFAULT_CTOR == GLM_DISABLE +# if GLM_CONFIG_CTOR_INIT == GLM_ENABLE template GLM_DEFAULTED_DEFAULT_CTOR_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat() -# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST - : value{col_type(1, 0, 0, 0), col_type(0, 1, 0, 0)} -# endif - { -# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALISATION - this->value[0] = col_type(1, 0, 0, 0); - this->value[1] = col_type(0, 1, 0, 0); -# endif - } + : value{col_type(1, 0, 0, 0), col_type(0, 1, 0, 0)} + {} # endif template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat(mat<2, 4, T, P> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = m[0]; - this->value[1] = m[1]; -# endif - } + : value{col_type(m[0]), col_type(m[1])} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat(T s) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(s, 0, 0, 0), col_type(0, s, 0, 0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(s, 0, 0, 0); - this->value[1] = col_type(0, s, 0, 0); -# endif - } + : value{col_type(s, 0, 0, 0), col_type(0, s, 0, 0)} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat @@ -47,27 +26,13 @@ namespace glm T x0, T y0, T z0, T w0, T x1, T y1, T z1, T w1 ) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(x0, y0, z0, w0), col_type(x1, y1, z1, w1)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(x0, y0, z0, w0); - this->value[1] = col_type(x1, y1, z1, w1); -# endif - } + : value{col_type(x0, y0, z0, w0), col_type(x1, y1, z1, w1)} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat(col_type const& v0, col_type const& v1) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(v0), col_type(v1)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = v0; - this->value[1] = v1; -# endif - } + : value{col_type(v0), col_type(v1)} + {} // -- Conversion constructors -- @@ -80,141 +45,64 @@ namespace glm X1 x1, Y1 y1, Z1 z1, W1 w1, X2 x2, Y2 y2, Z2 z2, W2 w2 ) -# if GLM_HAS_INITIALIZER_LISTS - : value{ - col_type(x1, y1, z1, w1), - col_type(x2, y2, z2, w2)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(x1, y1, z1, w1); - this->value[1] = col_type(x2, y2, z2, w2); -# endif - } + : value{ + col_type(x1, y1, z1, w1), + col_type(x2, y2, z2, w2)} + {} template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat(vec<4, V1, Q> const& v1, vec<4, V2, Q> const& v2) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(v1), col_type(v2)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(v1); - this->value[1] = col_type(v2); -# endif - } + : value{col_type(v1), col_type(v2)} + {} // -- Matrix conversions -- template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat(mat<2, 4, U, P> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); -# endif - } + : value{col_type(m[0]), col_type(m[1])} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat(mat<2, 2, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0], 0, 0), col_type(m[1], 0, 0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0], 0, 0); - this->value[1] = col_type(m[1], 0, 0); -# endif - } + : value{col_type(m[0], 0, 0), col_type(m[1], 0, 0)} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat(mat<3, 3, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0], 0), col_type(m[1], 0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0], 0); - this->value[1] = col_type(m[1], 0); -# endif - } + : value{col_type(m[0], 0), col_type(m[1], 0)} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat(mat<4, 4, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); -# endif - } + : value{col_type(m[0]), col_type(m[1])} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat(mat<2, 3, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0], 0), col_type(m[1], 0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0], 0); - this->value[1] = col_type(m[1], 0); -# endif - } + : value{col_type(m[0], 0), col_type(m[1], 0)} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat(mat<3, 2, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0], 0, 0), col_type(m[1], 0, 0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0], 0, 0); - this->value[1] = col_type(m[1], 0, 0); -# endif - } + : value{col_type(m[0], 0, 0), col_type(m[1], 0, 0)} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat(mat<3, 4, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); -# endif - } + : value{col_type(m[0]), col_type(m[1])} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat(mat<4, 2, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0], 0, 0), col_type(m[1], 0, 0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0], 0, 0); - this->value[1] = col_type(m[1], 0, 0); -# endif - } + : value{col_type(m[0], 0, 0), col_type(m[1], 0, 0)} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat(mat<4, 3, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0], 0), col_type(m[1], 0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0], 0); - this->value[1] = col_type(m[1], 0); -# endif - } + : value{col_type(m[0], 0), col_type(m[1], 0)} + {} // -- Accesses -- diff --git a/glm/detail/type_mat3x2.hpp b/glm/detail/type_mat3x2.hpp index 0249befd4..9574fc3d0 100644 --- a/glm/detail/type_mat3x2.hpp +++ b/glm/detail/type_mat3x2.hpp @@ -34,6 +34,7 @@ namespace glm // -- Constructors -- GLM_DEFAULTED_DEFAULT_CTOR_DECL GLM_CONSTEXPR mat() GLM_DEFAULT_CTOR; + GLM_CTOR_DECL mat(mat<3, 2, T, Q> const& m) = default; template GLM_CTOR_DECL mat(mat<3, 2, T, P> const& m); @@ -80,6 +81,8 @@ namespace glm // -- Unary arithmetic operators -- + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 2, T, Q>& operator=(mat<3, 2, T, Q> const& m) = default; + template GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 2, T, Q> & operator=(mat<3, 2, U, Q> const& m); template diff --git a/glm/detail/type_mat3x2.inl b/glm/detail/type_mat3x2.inl index dc7654d1d..8c1b8df89 100644 --- a/glm/detail/type_mat3x2.inl +++ b/glm/detail/type_mat3x2.inl @@ -2,47 +2,23 @@ namespace glm { // -- Constructors -- -# if GLM_CONFIG_DEFAULTED_DEFAULT_CTOR == GLM_DISABLE +# if GLM_CONFIG_CTOR_INIT == GLM_ENABLE template GLM_DEFAULTED_DEFAULT_CTOR_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat() -# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST - : value{col_type(1, 0), col_type(0, 1), col_type(0, 0)} -# endif - { -# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALISATION - this->value[0] = col_type(1, 0); - this->value[1] = col_type(0, 1); - this->value[2] = col_type(0, 0); -# endif - } + : value{col_type(1, 0), col_type(0, 1), col_type(0, 0)} + {} # endif template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat(mat<3, 2, T, P> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; -# endif - } + : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat(T s) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(s, 0), col_type(0, s), col_type(0, 0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(s, 0); - this->value[1] = col_type(0, s); - this->value[2] = col_type(0, 0); -# endif - } + : value{col_type(s, 0), col_type(0, s), col_type(0, 0)} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat @@ -51,29 +27,13 @@ namespace glm T x1, T y1, T x2, T y2 ) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(x0, y0), col_type(x1, y1), col_type(x2, y2)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(x0, y0); - this->value[1] = col_type(x1, y1); - this->value[2] = col_type(x2, y2); -# endif - } + : value{col_type(x0, y0), col_type(x1, y1), col_type(x2, y2)} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat(col_type const& v0, col_type const& v1, col_type const& v2) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(v0), col_type(v1), col_type(v2)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = v0; - this->value[1] = v1; - this->value[2] = v2; -# endif - } + : value{col_type(v0), col_type(v1), col_type(v2)} + {} // -- Conversion constructors -- @@ -88,150 +48,62 @@ namespace glm X1 x1, Y1 y1, X2 x2, Y2 y2 ) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(x0, y0), col_type(x1, y1), col_type(x2, y2)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(x0, y0); - this->value[1] = col_type(x1, y1); - this->value[2] = col_type(x2, y2); -# endif - } + : value{col_type(x0, y0), col_type(x1, y1), col_type(x2, y2)} + {} template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat(vec<2, V0, Q> const& v0, vec<2, V1, Q> const& v1, vec<2, V2, Q> const& v2) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(v0), col_type(v1), col_type(v2)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(v0); - this->value[1] = col_type(v1); - this->value[2] = col_type(v2); -# endif - } + : value{col_type(v0), col_type(v1), col_type(v2)} + {} // -- Matrix conversions -- template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat(mat<3, 2, U, P> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); -# endif - } + : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat(mat<2, 2, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = col_type(0); -# endif - } + : value{col_type(m[0]), col_type(m[1]), col_type(0)} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat(mat<3, 3, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); -# endif - } + : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat(mat<4, 4, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); -# endif - } + : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat(mat<2, 3, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(0); -# endif - } + : value{col_type(m[0]), col_type(m[1]), col_type(0)} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat(mat<2, 4, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(0); -# endif - } + : value{col_type(m[0]), col_type(m[1]), col_type(0)} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat(mat<3, 4, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); -# endif - } + : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat(mat<4, 2, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; -# endif - } + : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat(mat<4, 3, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); -# endif - } + : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} + {} // -- Accesses -- diff --git a/glm/detail/type_mat3x3.hpp b/glm/detail/type_mat3x3.hpp index e4cbbdced..1517b2cbb 100644 --- a/glm/detail/type_mat3x3.hpp +++ b/glm/detail/type_mat3x3.hpp @@ -33,6 +33,7 @@ namespace glm // -- Constructors -- GLM_DEFAULTED_DEFAULT_CTOR_DECL GLM_CONSTEXPR mat() GLM_DEFAULT_CTOR; + GLM_CTOR_DECL mat(mat<3, 3, T, Q> const& m) = default; template GLM_CTOR_DECL mat(mat<3, 3, T, P> const& m); @@ -79,29 +80,31 @@ namespace glm // -- Unary arithmetic operators -- + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 3, T, Q>& operator=(mat<3, 3, T, Q> const& m) = default; + template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 3, T, Q> & operator=(mat<3, 3, U, Q> const& m); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 3, T, Q>& operator=(mat<3, 3, U, Q> const& m); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 3, T, Q> & operator+=(U s); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 3, T, Q>& operator+=(U s); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 3, T, Q> & operator+=(mat<3, 3, U, Q> const& m); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 3, T, Q>& operator+=(mat<3, 3, U, Q> const& m); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 3, T, Q> & operator-=(U s); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 3, T, Q>& operator-=(U s); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 3, T, Q> & operator-=(mat<3, 3, U, Q> const& m); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 3, T, Q>& operator-=(mat<3, 3, U, Q> const& m); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 3, T, Q> & operator*=(U s); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 3, T, Q>& operator*=(U s); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 3, T, Q> & operator*=(mat<3, 3, U, Q> const& m); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 3, T, Q>& operator*=(mat<3, 3, U, Q> const& m); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 3, T, Q> & operator/=(U s); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 3, T, Q>& operator/=(U s); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 3, T, Q> & operator/=(mat<3, 3, U, Q> const& m); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 3, T, Q>& operator/=(mat<3, 3, U, Q> const& m); // -- Increment and decrement operators -- - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 3, T, Q> & operator++(); - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 3, T, Q> & operator--(); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 3, T, Q>& operator++(); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 3, T, Q>& operator--(); GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 3, T, Q> operator++(int); GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 3, T, Q> operator--(int); }; diff --git a/glm/detail/type_mat3x3.inl b/glm/detail/type_mat3x3.inl index d81bdf299..a3fb21bbd 100644 --- a/glm/detail/type_mat3x3.inl +++ b/glm/detail/type_mat3x3.inl @@ -5,47 +5,23 @@ namespace glm { // -- Constructors -- -# if GLM_CONFIG_DEFAULTED_DEFAULT_CTOR == GLM_DISABLE +# if GLM_CONFIG_CTOR_INIT == GLM_ENABLE template GLM_DEFAULTED_DEFAULT_CTOR_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat() -# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST - : value{col_type(1, 0, 0), col_type(0, 1, 0), col_type(0, 0, 1)} -# endif - { -# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALISATION - this->value[0] = col_type(1, 0, 0); - this->value[1] = col_type(0, 1, 0); - this->value[2] = col_type(0, 0, 1); -# endif - } + : value{col_type(1, 0, 0), col_type(0, 1, 0), col_type(0, 0, 1)} + {} # endif template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat(mat<3, 3, T, P> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); -# endif - } + : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat(T s) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(s, 0, 0), col_type(0, s, 0), col_type(0, 0, s)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(s, 0, 0); - this->value[1] = col_type(0, s, 0); - this->value[2] = col_type(0, 0, s); -# endif - } + : value{col_type(s, 0, 0), col_type(0, s, 0), col_type(0, 0, s)} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat @@ -54,29 +30,13 @@ namespace glm T x1, T y1, T z1, T x2, T y2, T z2 ) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(x0, y0, z0), col_type(x1, y1, z1), col_type(x2, y2, z2)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(x0, y0, z0); - this->value[1] = col_type(x1, y1, z1); - this->value[2] = col_type(x2, y2, z2); -# endif - } + : value{col_type(x0, y0, z0), col_type(x1, y1, z1), col_type(x2, y2, z2)} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat(col_type const& v0, col_type const& v1, col_type const& v2) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(v0), col_type(v1), col_type(v2)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(v0); - this->value[1] = col_type(v1); - this->value[2] = col_type(v2); -# endif - } + : value{col_type(v0), col_type(v1), col_type(v2)} + {} // -- Conversion constructors -- @@ -91,150 +51,62 @@ namespace glm X2 x2, Y2 y2, Z2 z2, X3 x3, Y3 y3, Z3 z3 ) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(x1, y1, z1), col_type(x2, y2, z2), col_type(x3, y3, z3)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(x1, y1, z1); - this->value[1] = col_type(x2, y2, z2); - this->value[2] = col_type(x3, y3, z3); -# endif - } + : value{col_type(x1, y1, z1), col_type(x2, y2, z2), col_type(x3, y3, z3)} + {} template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat(vec<3, V1, Q> const& v1, vec<3, V2, Q> const& v2, vec<3, V3, Q> const& v3) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(v1), col_type(v2), col_type(v3)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(v1); - this->value[1] = col_type(v2); - this->value[2] = col_type(v3); -# endif - } + : value{col_type(v1), col_type(v2), col_type(v3)} + {} // -- Matrix conversions -- template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat(mat<3, 3, U, P> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); -# endif - } + : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat(mat<2, 2, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0], 0), col_type(m[1], 0), col_type(0, 0, 1)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0], 0); - this->value[1] = col_type(m[1], 0); - this->value[2] = col_type(0, 0, 1); -# endif - } + : value{col_type(m[0], 0), col_type(m[1], 0), col_type(0, 0, 1)} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat(mat<4, 4, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); -# endif - } + : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat(mat<2, 3, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(0, 0, 1)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(0, 0, 1); -# endif - } + : value{col_type(m[0]), col_type(m[1]), col_type(0, 0, 1)} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat(mat<3, 2, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0], 0), col_type(m[1], 0), col_type(m[2], 1)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0], 0); - this->value[1] = col_type(m[1], 0); - this->value[2] = col_type(m[2], 1); -# endif - } + : value{col_type(m[0], 0), col_type(m[1], 0), col_type(m[2], 1)} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat(mat<2, 4, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(0, 0, 1)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(0, 0, 1); -# endif - } + : value{col_type(m[0]), col_type(m[1]), col_type(0, 0, 1)} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat(mat<4, 2, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0], 0), col_type(m[1], 0), col_type(m[2], 1)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0], 0); - this->value[1] = col_type(m[1], 0); - this->value[2] = col_type(m[2], 1); -# endif - } + : value{col_type(m[0], 0), col_type(m[1], 0), col_type(m[2], 1)} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat(mat<3, 4, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); -# endif - } + : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat(mat<4, 3, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); -# endif - } + : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} + {} // -- Accesses -- diff --git a/glm/detail/type_mat3x4.hpp b/glm/detail/type_mat3x4.hpp index f9913d271..75c57a5ef 100644 --- a/glm/detail/type_mat3x4.hpp +++ b/glm/detail/type_mat3x4.hpp @@ -34,6 +34,7 @@ namespace glm // -- Constructors -- GLM_DEFAULTED_DEFAULT_CTOR_DECL GLM_CONSTEXPR mat() GLM_DEFAULT_CTOR; + GLM_CTOR_DECL mat(mat<3, 4, T, Q> const& m) = default; template GLM_CTOR_DECL mat(mat<3, 4, T, P> const& m); @@ -80,25 +81,27 @@ namespace glm // -- Unary arithmetic operators -- + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 4, T, Q>& operator=(mat<3, 4, T, Q> const& m) = default; + template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 4, T, Q> & operator=(mat<3, 4, U, Q> const& m); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 4, T, Q>& operator=(mat<3, 4, U, Q> const& m); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 4, T, Q> & operator+=(U s); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 4, T, Q>& operator+=(U s); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 4, T, Q> & operator+=(mat<3, 4, U, Q> const& m); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 4, T, Q>& operator+=(mat<3, 4, U, Q> const& m); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 4, T, Q> & operator-=(U s); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 4, T, Q>& operator-=(U s); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 4, T, Q> & operator-=(mat<3, 4, U, Q> const& m); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 4, T, Q>& operator-=(mat<3, 4, U, Q> const& m); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 4, T, Q> & operator*=(U s); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 4, T, Q>& operator*=(U s); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 4, T, Q> & operator/=(U s); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 4, T, Q>& operator/=(U s); // -- Increment and decrement operators -- - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 4, T, Q> & operator++(); - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 4, T, Q> & operator--(); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 4, T, Q>& operator++(); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<3, 4, T, Q>& operator--(); GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 4, T, Q> operator++(int); GLM_FUNC_DECL GLM_CONSTEXPR mat<3, 4, T, Q> operator--(int); }; diff --git a/glm/detail/type_mat3x4.inl b/glm/detail/type_mat3x4.inl index a4afac0da..ea456a8c1 100644 --- a/glm/detail/type_mat3x4.inl +++ b/glm/detail/type_mat3x4.inl @@ -2,47 +2,23 @@ namespace glm { // -- Constructors -- -# if GLM_CONFIG_DEFAULTED_DEFAULT_CTOR == GLM_DISABLE +# if GLM_CONFIG_CTOR_INIT == GLM_ENABLE template GLM_DEFAULTED_DEFAULT_CTOR_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat() -# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST - : value{col_type(1, 0, 0, 0), col_type(0, 1, 0, 0), col_type(0, 0, 1, 0)} -# endif - { -# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALISATION - this->value[0] = col_type(1, 0, 0, 0); - this->value[1] = col_type(0, 1, 0, 0); - this->value[2] = col_type(0, 0, 1, 0); -# endif - } + : value{col_type(1, 0, 0, 0), col_type(0, 1, 0, 0), col_type(0, 0, 1, 0)} + {} # endif template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(mat<3, 4, T, P> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; -# endif - } + : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(T s) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(s, 0, 0, 0), col_type(0, s, 0, 0), col_type(0, 0, s, 0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(s, 0, 0, 0); - this->value[1] = col_type(0, s, 0, 0); - this->value[2] = col_type(0, 0, s, 0); -# endif - } + : value{col_type(s, 0, 0, 0), col_type(0, s, 0, 0), col_type(0, 0, s, 0)} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat @@ -51,32 +27,16 @@ namespace glm T x1, T y1, T z1, T w1, T x2, T y2, T z2, T w2 ) -# if GLM_HAS_INITIALIZER_LISTS - : value{ - col_type(x0, y0, z0, w0), - col_type(x1, y1, z1, w1), - col_type(x2, y2, z2, w2)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(x0, y0, z0, w0); - this->value[1] = col_type(x1, y1, z1, w1); - this->value[2] = col_type(x2, y2, z2, w2); -# endif - } + : value{ + col_type(x0, y0, z0, w0), + col_type(x1, y1, z1, w1), + col_type(x2, y2, z2, w2)} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(col_type const& v0, col_type const& v1, col_type const& v2) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(v0), col_type(v1), col_type(v2)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = v0; - this->value[1] = v1; - this->value[2] = v2; -# endif - } + : value{col_type(v0), col_type(v1), col_type(v2)} + {} // -- Conversion constructors -- @@ -91,153 +51,65 @@ namespace glm X1 x1, Y1 y1, Z1 z1, W1 w1, X2 x2, Y2 y2, Z2 z2, W2 w2 ) -# if GLM_HAS_INITIALIZER_LISTS - : value{ - col_type(x0, y0, z0, w0), - col_type(x1, y1, z1, w1), - col_type(x2, y2, z2, w2)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(x0, y0, z0, w0); - this->value[1] = col_type(x1, y1, z1, w1); - this->value[2] = col_type(x2, y2, z2, w2); -# endif - } + : value{ + col_type(x0, y0, z0, w0), + col_type(x1, y1, z1, w1), + col_type(x2, y2, z2, w2)} + {} template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(vec<4, V1, Q> const& v0, vec<4, V2, Q> const& v1, vec<4, V3, Q> const& v2) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(v0), col_type(v1), col_type(v2)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(v0); - this->value[1] = col_type(v1); - this->value[2] = col_type(v2); -# endif - } + : value{col_type(v0), col_type(v1), col_type(v2)} + {} // -- Matrix conversions -- template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(mat<3, 4, U, P> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); -# endif - } + : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(mat<2, 2, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0], 0, 0), col_type(m[1], 0, 0), col_type(0, 0, 1, 0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0], 0, 0); - this->value[1] = col_type(m[1], 0, 0); - this->value[2] = col_type(0, 0, 1, 0); -# endif - } + : value{col_type(m[0], 0, 0), col_type(m[1], 0, 0), col_type(0, 0, 1, 0)} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(mat<3, 3, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0], 0), col_type(m[1], 0), col_type(m[2], 0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0], 0); - this->value[1] = col_type(m[1], 0); - this->value[2] = col_type(m[2], 0); -# endif - } + : value{col_type(m[0], 0), col_type(m[1], 0), col_type(m[2], 0)} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(mat<4, 4, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); -# endif - } + : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(mat<2, 3, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0], 0), col_type(m[1], 0), col_type(0, 0, 1, 0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0], 0); - this->value[1] = col_type(m[1], 0); - this->value[2] = col_type(0, 0, 1, 0); -# endif - } + : value{col_type(m[0], 0), col_type(m[1], 0), col_type(0, 0, 1, 0)} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(mat<3, 2, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0], 0, 0), col_type(m[1], 0, 0), col_type(m[2], 1, 0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0], 0, 0); - this->value[1] = col_type(m[1], 0, 0); - this->value[2] = col_type(m[2], 1, 0); -# endif - } + : value{col_type(m[0], 0, 0), col_type(m[1], 0, 0), col_type(m[2], 1, 0)} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(mat<2, 4, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(0, 0, 1, 0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(0, 0, 1, 0); -# endif - } + : value{col_type(m[0]), col_type(m[1]), col_type(0, 0, 1, 0)} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(mat<4, 2, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0], 0, 0), col_type(m[1], 0, 0), col_type(m[2], 1, 0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0], 0, 0); - this->value[1] = col_type(m[1], 0, 0); - this->value[2] = col_type(m[2], 1, 0); -# endif - } + : value{col_type(m[0], 0, 0), col_type(m[1], 0, 0), col_type(m[2], 1, 0)} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(mat<4, 3, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0], 0), col_type(m[1], 0), col_type(m[2], 0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0], 0); - this->value[1] = col_type(m[1], 0); - this->value[2] = col_type(m[2], 0); -# endif - } + : value{col_type(m[0], 0), col_type(m[1], 0), col_type(m[2], 0)} + {} // -- Accesses -- diff --git a/glm/detail/type_mat4x2.hpp b/glm/detail/type_mat4x2.hpp index 7057d4ce1..8584d85e0 100644 --- a/glm/detail/type_mat4x2.hpp +++ b/glm/detail/type_mat4x2.hpp @@ -34,6 +34,7 @@ namespace glm // -- Constructors -- GLM_DEFAULTED_DEFAULT_CTOR_DECL GLM_CONSTEXPR mat() GLM_DEFAULT_CTOR; + GLM_CTOR_DECL mat(mat<4, 2, T, Q> const& m) = default; template GLM_CTOR_DECL mat(mat<4, 2, T, P> const& m); @@ -85,25 +86,27 @@ namespace glm // -- Unary arithmetic operators -- + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 2, T, Q>& operator=(mat<4, 2, T, Q> const& m) = default; + template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 2, T, Q> & operator=(mat<4, 2, U, Q> const& m); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 2, T, Q>& operator=(mat<4, 2, U, Q> const& m); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 2, T, Q> & operator+=(U s); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 2, T, Q>& operator+=(U s); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 2, T, Q> & operator+=(mat<4, 2, U, Q> const& m); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 2, T, Q>& operator+=(mat<4, 2, U, Q> const& m); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 2, T, Q> & operator-=(U s); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 2, T, Q>& operator-=(U s); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 2, T, Q> & operator-=(mat<4, 2, U, Q> const& m); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 2, T, Q>& operator-=(mat<4, 2, U, Q> const& m); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 2, T, Q> & operator*=(U s); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 2, T, Q>& operator*=(U s); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 2, T, Q> & operator/=(U s); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 2, T, Q>& operator/=(U s); // -- Increment and decrement operators -- - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 2, T, Q> & operator++ (); - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 2, T, Q> & operator-- (); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 2, T, Q>& operator++ (); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 2, T, Q>& operator-- (); GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 2, T, Q> operator++(int); GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 2, T, Q> operator--(int); }; diff --git a/glm/detail/type_mat4x2.inl b/glm/detail/type_mat4x2.inl index 0b7ff048c..a62af1ad0 100644 --- a/glm/detail/type_mat4x2.inl +++ b/glm/detail/type_mat4x2.inl @@ -2,50 +2,23 @@ namespace glm { // -- Constructors -- -# if GLM_CONFIG_DEFAULTED_DEFAULT_CTOR == GLM_DISABLE +# if GLM_CONFIG_CTOR_INIT == GLM_ENABLE template GLM_DEFAULTED_DEFAULT_CTOR_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat() -# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST - : value{col_type(1, 0), col_type(0, 1), col_type(0, 0), col_type(0, 0)} -# endif - { -# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALISATION - this->value[0] = col_type(1, 0); - this->value[1] = col_type(0, 1); - this->value[2] = col_type(0, 0); - this->value[3] = col_type(0, 0); -# endif - } + : value{col_type(1, 0), col_type(0, 1), col_type(0, 0), col_type(0, 0)} + {} # endif template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(mat<4, 2, T, P> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(m[3])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - this->value[3] = m[3]; -# endif - } + : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(m[3])} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(T s) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(s, 0), col_type(0, s), col_type(0, 0), col_type(0, 0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(s, 0); - this->value[1] = col_type(0, s); - this->value[2] = col_type(0, 0); - this->value[3] = col_type(0, 0); -# endif - } + : value{col_type(s, 0), col_type(0, s), col_type(0, 0), col_type(0, 0)} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat @@ -55,31 +28,13 @@ namespace glm T x2, T y2, T x3, T y3 ) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(x0, y0), col_type(x1, y1), col_type(x2, y2), col_type(x3, y3)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(x0, y0); - this->value[1] = col_type(x1, y1); - this->value[2] = col_type(x2, y2); - this->value[3] = col_type(x3, y3); -# endif - } + : value{col_type(x0, y0), col_type(x1, y1), col_type(x2, y2), col_type(x3, y3)} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(col_type const& v0, col_type const& v1, col_type const& v2, col_type const& v3) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(v0), col_type(v1), col_type(v2), col_type(v3)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = v0; - this->value[1] = v1; - this->value[2] = v2; - this->value[3] = v3; -# endif - } + : value{col_type(v0), col_type(v1), col_type(v2), col_type(v3)} + {} // -- Conversion constructors -- @@ -96,161 +51,62 @@ namespace glm X2 x2, Y2 y2, X3 x3, Y3 y3 ) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(x0, y0), col_type(x1, y1), col_type(x2, y2), col_type(x3, y3)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(x0, y0); - this->value[1] = col_type(x1, y1); - this->value[2] = col_type(x2, y2); - this->value[3] = col_type(x3, y3); -# endif - } + : value{col_type(x0, y0), col_type(x1, y1), col_type(x2, y2), col_type(x3, y3)} + {} template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(vec<2, V0, Q> const& v0, vec<2, V1, Q> const& v1, vec<2, V2, Q> const& v2, vec<2, V3, Q> const& v3) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(v0), col_type(v1), col_type(v2), col_type(v3)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(v0); - this->value[1] = col_type(v1); - this->value[2] = col_type(v2); - this->value[3] = col_type(v3); -# endif - } + : value{col_type(v0), col_type(v1), col_type(v2), col_type(v3)} + {} // -- Conversion -- template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(mat<4, 2, U, P> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(m[3])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); - this->value[3] = col_type(m[3]); -# endif - } + : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(m[3])} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(mat<2, 2, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(0), col_type(0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(0); - this->value[3] = col_type(0); -# endif - } + : value{col_type(m[0]), col_type(m[1]), col_type(0), col_type(0)} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(mat<3, 3, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); - this->value[3] = col_type(0); -# endif - } + : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(0)} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(mat<4, 4, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(m[3])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); - this->value[3] = col_type(m[3]); -# endif - } + : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(m[3])} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(mat<2, 3, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(0), col_type(0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(0); - this->value[3] = col_type(0); -# endif - } + : value{col_type(m[0]), col_type(m[1]), col_type(0), col_type(0)} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(mat<3, 2, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); - this->value[3] = col_type(0); -# endif - } + : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(0)} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(mat<2, 4, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(0), col_type(0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(0); - this->value[3] = col_type(0); -# endif - } + : value{col_type(m[0]), col_type(m[1]), col_type(0), col_type(0)} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(mat<4, 3, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(m[3])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); - this->value[3] = col_type(m[3]); -# endif - } + : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(m[3])} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(mat<3, 4, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); - this->value[3] = col_type(0); -# endif - } + : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(0)} + {} // -- Accesses -- diff --git a/glm/detail/type_mat4x3.hpp b/glm/detail/type_mat4x3.hpp index 52a38d871..af5620b10 100644 --- a/glm/detail/type_mat4x3.hpp +++ b/glm/detail/type_mat4x3.hpp @@ -34,6 +34,7 @@ namespace glm // -- Constructors -- GLM_DEFAULTED_DEFAULT_CTOR_DECL GLM_CONSTEXPR mat() GLM_DEFAULT_CTOR; + GLM_CTOR_DECL mat(mat<4, 3, T, Q> const& m) = default; template GLM_CTOR_DECL mat(mat<4, 3, T, P> const& m); @@ -85,20 +86,22 @@ namespace glm // -- Unary arithmetic operators -- + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 3, T, Q>& operator=(mat<4, 3, T, Q> const& m) = default; + template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 3, T, Q> & operator=(mat<4, 3, U, Q> const& m); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 3, T, Q>& operator=(mat<4, 3, U, Q> const& m); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 3, T, Q> & operator+=(U s); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 3, T, Q>& operator+=(U s); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 3, T, Q> & operator+=(mat<4, 3, U, Q> const& m); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 3, T, Q>& operator+=(mat<4, 3, U, Q> const& m); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 3, T, Q> & operator-=(U s); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 3, T, Q>& operator-=(U s); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 3, T, Q> & operator-=(mat<4, 3, U, Q> const& m); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 3, T, Q>& operator-=(mat<4, 3, U, Q> const& m); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 3, T, Q> & operator*=(U s); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 3, T, Q>& operator*=(U s); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 3, T, Q> & operator/=(U s); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 3, T, Q>& operator/=(U s); // -- Increment and decrement operators -- diff --git a/glm/detail/type_mat4x3.inl b/glm/detail/type_mat4x3.inl index ab438ffce..0f60213e8 100644 --- a/glm/detail/type_mat4x3.inl +++ b/glm/detail/type_mat4x3.inl @@ -2,50 +2,23 @@ namespace glm { // -- Constructors -- -# if GLM_CONFIG_DEFAULTED_DEFAULT_CTOR == GLM_DISABLE +# if GLM_CONFIG_CTOR_INIT == GLM_ENABLE template GLM_DEFAULTED_DEFAULT_CTOR_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat() -# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST - : value{col_type(1, 0, 0), col_type(0, 1, 0), col_type(0, 0, 1), col_type(0, 0, 0)} -# endif - { -# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALISATION - this->value[0] = col_type(1, 0, 0); - this->value[1] = col_type(0, 1, 0); - this->value[2] = col_type(0, 0, 1); - this->value[3] = col_type(0, 0, 0); -# endif - } + : value{col_type(1, 0, 0), col_type(0, 1, 0), col_type(0, 0, 1), col_type(0, 0, 0)} + {} # endif template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat(mat<4, 3, T, P> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(m[3])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - this->value[3] = m[3]; -# endif - } + : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(m[3])} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat(T s) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(s, 0, 0), col_type(0, s, 0), col_type(0, 0, s), col_type(0, 0, 0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(s, 0, 0); - this->value[1] = col_type(0, s, 0); - this->value[2] = col_type(0, 0, s); - this->value[3] = col_type(0, 0, 0); -# endif - } + : value{col_type(s, 0, 0), col_type(0, s, 0), col_type(0, 0, s), col_type(0, 0, 0)} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat @@ -55,31 +28,13 @@ namespace glm T const& x2, T const& y2, T const& z2, T const& x3, T const& y3, T const& z3 ) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(x0, y0, z0), col_type(x1, y1, z1), col_type(x2, y2, z2), col_type(x3, y3, z3)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(x0, y0, z0); - this->value[1] = col_type(x1, y1, z1); - this->value[2] = col_type(x2, y2, z2); - this->value[3] = col_type(x3, y3, z3); -# endif - } + : value{col_type(x0, y0, z0), col_type(x1, y1, z1), col_type(x2, y2, z2), col_type(x3, y3, z3)} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat(col_type const& v0, col_type const& v1, col_type const& v2, col_type const& v3) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(v0), col_type(v1), col_type(v2), col_type(v3)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = v0; - this->value[1] = v1; - this->value[2] = v2; - this->value[3] = v3; -# endif - } + : value{col_type(v0), col_type(v1), col_type(v2), col_type(v3)} + {} // -- Conversion constructors -- @@ -96,161 +51,62 @@ namespace glm X2 const& x2, Y2 const& y2, Z2 const& z2, X3 const& x3, Y3 const& y3, Z3 const& z3 ) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(x0, y0, z0), col_type(x1, y1, z1), col_type(x2, y2, z2), col_type(x3, y3, z3)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(x0, y0, z0); - this->value[1] = col_type(x1, y1, z1); - this->value[2] = col_type(x2, y2, z2); - this->value[3] = col_type(x3, y3, z3); -# endif - } + : value{col_type(x0, y0, z0), col_type(x1, y1, z1), col_type(x2, y2, z2), col_type(x3, y3, z3)} + {} template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat(vec<3, V1, Q> const& v1, vec<3, V2, Q> const& v2, vec<3, V3, Q> const& v3, vec<3, V4, Q> const& v4) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(v1), col_type(v2), col_type(v3), col_type(v4)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(v1); - this->value[1] = col_type(v2); - this->value[2] = col_type(v3); - this->value[3] = col_type(v4); -# endif - } + : value{col_type(v1), col_type(v2), col_type(v3), col_type(v4)} + {} // -- Matrix conversions -- template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat(mat<4, 3, U, P> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(m[3])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); - this->value[3] = col_type(m[3]); -# endif - } + : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(m[3])} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat(mat<2, 2, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0], 0), col_type(m[1], 0), col_type(0, 0, 1), col_type(0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0], 0); - this->value[1] = col_type(m[1], 0); - this->value[2] = col_type(0, 0, 1); - this->value[3] = col_type(0); -# endif - } + : value{col_type(m[0], 0), col_type(m[1], 0), col_type(0, 0, 1), col_type(0)} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat(mat<3, 3, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); - this->value[3] = col_type(0); -# endif - } + : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(0)} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat(mat<4, 4, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(m[3])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); - this->value[3] = col_type(m[3]); -# endif - } + : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(m[3])} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat(mat<2, 3, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(0, 0, 1), col_type(0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(0, 0, 1); - this->value[3] = col_type(0); -# endif - } + : value{col_type(m[0]), col_type(m[1]), col_type(0, 0, 1), col_type(0)} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat(mat<3, 2, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0], 0), col_type(m[1], 0), col_type(m[2], 1), col_type(0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0], 0); - this->value[1] = col_type(m[1], 0); - this->value[2] = col_type(m[2], 1); - this->value[3] = col_type(0); -# endif - } + : value{col_type(m[0], 0), col_type(m[1], 0), col_type(m[2], 1), col_type(0)} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat(mat<2, 4, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(0, 0, 1), col_type(0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(0, 0, 1); - this->value[3] = col_type(0); -# endif - } + : value{col_type(m[0]), col_type(m[1]), col_type(0, 0, 1), col_type(0)} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat(mat<4, 2, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0], 0), col_type(m[1], 0), col_type(m[2], 1), col_type(m[3], 0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0], 0); - this->value[1] = col_type(m[1], 0); - this->value[2] = col_type(m[2], 1); - this->value[3] = col_type(m[3], 0); -# endif - } + : value{col_type(m[0], 0), col_type(m[1], 0), col_type(m[2], 1), col_type(m[3], 0)} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat(mat<3, 4, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); - this->value[3] = col_type(0); -# endif - } + : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(0)} + {} // -- Accesses -- diff --git a/glm/detail/type_mat4x4.hpp b/glm/detail/type_mat4x4.hpp index ad7597b8e..1930ac03d 100644 --- a/glm/detail/type_mat4x4.hpp +++ b/glm/detail/type_mat4x4.hpp @@ -33,6 +33,7 @@ namespace glm // -- Constructors -- GLM_DEFAULTED_DEFAULT_CTOR_DECL GLM_CONSTEXPR mat() GLM_DEFAULT_CTOR; + GLM_CTOR_DECL mat(mat<4, 4, T, Q> const& m) = default; template GLM_CTOR_DECL mat(mat<4, 4, T, P> const& m); @@ -84,29 +85,30 @@ namespace glm // -- Unary arithmetic operators -- + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 4, T, Q>& operator=(mat<4, 4, T, Q> const& m) = default; template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 4, T, Q> & operator=(mat<4, 4, U, Q> const& m); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 4, T, Q>& operator=(mat<4, 4, U, Q> const& m); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 4, T, Q> & operator+=(U s); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 4, T, Q>& operator+=(U s); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 4, T, Q> & operator+=(mat<4, 4, U, Q> const& m); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 4, T, Q>& operator+=(mat<4, 4, U, Q> const& m); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 4, T, Q> & operator-=(U s); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 4, T, Q>& operator-=(U s); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 4, T, Q> & operator-=(mat<4, 4, U, Q> const& m); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 4, T, Q>& operator-=(mat<4, 4, U, Q> const& m); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 4, T, Q> & operator*=(U s); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 4, T, Q>& operator*=(U s); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 4, T, Q> & operator*=(mat<4, 4, U, Q> const& m); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 4, T, Q>& operator*=(mat<4, 4, U, Q> const& m); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 4, T, Q> & operator/=(U s); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 4, T, Q>& operator/=(U s); template - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 4, T, Q> & operator/=(mat<4, 4, U, Q> const& m); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 4, T, Q>& operator/=(mat<4, 4, U, Q> const& m); // -- Increment and decrement operators -- - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 4, T, Q> & operator++(); - GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 4, T, Q> & operator--(); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 4, T, Q>& operator++(); + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR mat<4, 4, T, Q>& operator--(); GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 4, T, Q> operator++(int); GLM_FUNC_DECL GLM_CONSTEXPR mat<4, 4, T, Q> operator--(int); }; diff --git a/glm/detail/type_mat4x4.inl b/glm/detail/type_mat4x4.inl index 270c07b79..9d4b8ceae 100644 --- a/glm/detail/type_mat4x4.inl +++ b/glm/detail/type_mat4x4.inl @@ -5,50 +5,23 @@ namespace glm { // -- Constructors -- -# if GLM_CONFIG_DEFAULTED_DEFAULT_CTOR == GLM_DISABLE +# if GLM_CONFIG_CTOR_INIT == GLM_ENABLE template GLM_DEFAULTED_DEFAULT_CTOR_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat() -# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST - : value{col_type(1, 0, 0, 0), col_type(0, 1, 0, 0), col_type(0, 0, 1, 0), col_type(0, 0, 0, 1)} -# endif - { -# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALISATION - this->value[0] = col_type(1, 0, 0, 0); - this->value[1] = col_type(0, 1, 0, 0); - this->value[2] = col_type(0, 0, 1, 0); - this->value[3] = col_type(0, 0, 0, 1); -# endif - } + : value{col_type(1, 0, 0, 0), col_type(0, 1, 0, 0), col_type(0, 0, 1, 0), col_type(0, 0, 0, 1)} + {} # endif template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat(mat<4, 4, T, P> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(m[3])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - this->value[3] = m[3]; -# endif - } + : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(m[3])} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat(T s) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(s, 0, 0, 0), col_type(0, s, 0, 0), col_type(0, 0, s, 0), col_type(0, 0, 0, s)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(s, 0, 0, 0); - this->value[1] = col_type(0, s, 0, 0); - this->value[2] = col_type(0, 0, s, 0); - this->value[3] = col_type(0, 0, 0, s); -# endif - } + : value{col_type(s, 0, 0, 0), col_type(0, s, 0, 0), col_type(0, 0, s, 0), col_type(0, 0, 0, s)} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat @@ -58,50 +31,23 @@ namespace glm T const& x2, T const& y2, T const& z2, T const& w2, T const& x3, T const& y3, T const& z3, T const& w3 ) -# if GLM_HAS_INITIALIZER_LISTS - : value{ - col_type(x0, y0, z0, w0), - col_type(x1, y1, z1, w1), - col_type(x2, y2, z2, w2), - col_type(x3, y3, z3, w3)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(x0, y0, z0, w0); - this->value[1] = col_type(x1, y1, z1, w1); - this->value[2] = col_type(x2, y2, z2, w2); - this->value[3] = col_type(x3, y3, z3, w3); -# endif - } + : value{ + col_type(x0, y0, z0, w0), + col_type(x1, y1, z1, w1), + col_type(x2, y2, z2, w2), + col_type(x3, y3, z3, w3)} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat(col_type const& v0, col_type const& v1, col_type const& v2, col_type const& v3) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(v0), col_type(v1), col_type(v2), col_type(v3)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = v0; - this->value[1] = v1; - this->value[2] = v2; - this->value[3] = v3; -# endif - } + : value{col_type(v0), col_type(v1), col_type(v2), col_type(v3)} + {} template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat(mat<4, 4, U, P> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(m[3])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); - this->value[3] = col_type(m[3]); -# endif - } + : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(m[3])} + {} // -- Conversions -- @@ -118,9 +64,7 @@ namespace glm X3 const& x3, Y3 const& y3, Z3 const& z3, W3 const& w3, X4 const& x4, Y4 const& y4, Z4 const& z4, W4 const& w4 ) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(x1, y1, z1, w1), col_type(x2, y2, z2, w2), col_type(x3, y3, z3, w3), col_type(x4, y4, z4, w4)} -# endif + : value{col_type(x1, y1, z1, w1), col_type(x2, y2, z2, w2), col_type(x3, y3, z3, w3), col_type(x4, y4, z4, w4)} { static_assert(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 1st parameter type invalid."); static_assert(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 2nd parameter type invalid."); @@ -141,148 +85,60 @@ namespace glm static_assert(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 14th parameter type invalid."); static_assert(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 15th parameter type invalid."); static_assert(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 16th parameter type invalid."); - -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(x1, y1, z1, w1); - this->value[1] = col_type(x2, y2, z2, w2); - this->value[2] = col_type(x3, y3, z3, w3); - this->value[3] = col_type(x4, y4, z4, w4); -# endif } template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat(vec<4, V1, Q> const& v1, vec<4, V2, Q> const& v2, vec<4, V3, Q> const& v3, vec<4, V4, Q> const& v4) -# if GLM_HAS_INITIALIZER_LISTS : value{col_type(v1), col_type(v2), col_type(v3), col_type(v4)} -# endif { static_assert(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 1st parameter type invalid."); static_assert(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 2nd parameter type invalid."); static_assert(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 3rd parameter type invalid."); static_assert(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 4th parameter type invalid."); - -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(v1); - this->value[1] = col_type(v2); - this->value[2] = col_type(v3); - this->value[3] = col_type(v4); -# endif } // -- Matrix conversions -- template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat(mat<2, 2, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0], 0, 0), col_type(m[1], 0, 0), col_type(0, 0, 1, 0), col_type(0, 0, 0, 1)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0], 0, 0); - this->value[1] = col_type(m[1], 0, 0); - this->value[2] = col_type(0, 0, 1, 0); - this->value[3] = col_type(0, 0, 0, 1); -# endif - } + : value{col_type(m[0], 0, 0), col_type(m[1], 0, 0), col_type(0, 0, 1, 0), col_type(0, 0, 0, 1)} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat(mat<3, 3, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0], 0), col_type(m[1], 0), col_type(m[2], 0), col_type(0, 0, 0, 1)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0], 0); - this->value[1] = col_type(m[1], 0); - this->value[2] = col_type(m[2], 0); - this->value[3] = col_type(0, 0, 0, 1); -# endif - } + : value{col_type(m[0], 0), col_type(m[1], 0), col_type(m[2], 0), col_type(0, 0, 0, 1)} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat(mat<2, 3, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0], 0), col_type(m[1], 0), col_type(0, 0, 1, 0), col_type(0, 0, 0, 1)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0], 0); - this->value[1] = col_type(m[1], 0); - this->value[2] = col_type(0, 0, 1, 0); - this->value[3] = col_type(0, 0, 0, 1); -# endif - } + : value{col_type(m[0], 0), col_type(m[1], 0), col_type(0, 0, 1, 0), col_type(0, 0, 0, 1)} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat(mat<3, 2, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0], 0, 0), col_type(m[1], 0, 0), col_type(m[2], 1, 0), col_type(0, 0, 0, 1)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0], 0, 0); - this->value[1] = col_type(m[1], 0, 0); - this->value[2] = col_type(m[2], 1, 0); - this->value[3] = col_type(0, 0, 0, 1); -# endif - } + : value{col_type(m[0], 0, 0), col_type(m[1], 0, 0), col_type(m[2], 1, 0), col_type(0, 0, 0, 1)} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat(mat<2, 4, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(0, 0, 1, 0), col_type(0, 0, 0, 1)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = col_type(0, 0, 1, 0); - this->value[3] = col_type(0, 0, 0, 1); -# endif - } + : value{col_type(m[0]), col_type(m[1]), col_type(0, 0, 1, 0), col_type(0, 0, 0, 1)} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat(mat<4, 2, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0], 0, 0), col_type(m[1], 0, 0), col_type(0, 0, 1, 0), col_type(0, 0, 0, 1)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0], 0, 0); - this->value[1] = col_type(m[1], 0, 0); - this->value[2] = col_type(0, 0, 1, 0); - this->value[3] = col_type(0, 0, 0, 1); -# endif - } + : value{col_type(m[0], 0, 0), col_type(m[1], 0, 0), col_type(0, 0, 1, 0), col_type(0, 0, 0, 1)} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat(mat<3, 4, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(0, 0, 0, 1)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - this->value[3] = col_type(0, 0, 0, 1); -# endif - } + : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(0, 0, 0, 1)} + {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat(mat<4, 3, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0], 0), col_type(m[1], 0), col_type(m[2], 0), col_type(m[3], 1)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0], 0); - this->value[1] = col_type(m[1], 0); - this->value[2] = col_type(m[2], 0); - this->value[3] = col_type(m[3], 1); -# endif - } + : value{col_type(m[0], 0), col_type(m[1], 0), col_type(m[2], 0), col_type(m[3], 1)} + {} // -- Accesses -- diff --git a/glm/detail/type_quat.hpp b/glm/detail/type_quat.hpp index a1ac36ff7..46aa29364 100644 --- a/glm/detail/type_quat.hpp +++ b/glm/detail/type_quat.hpp @@ -71,7 +71,7 @@ namespace glm // -- Implicit basic constructors -- GLM_DEFAULTED_DEFAULT_CTOR_DECL GLM_CONSTEXPR qua() GLM_DEFAULT_CTOR; - GLM_DEFAULTED_FUNC_DECL GLM_CONSTEXPR qua(qua const& q) GLM_DEFAULT; + GLM_CTOR_DECL qua(qua const& q) = default; template GLM_CTOR_DECL qua(qua const& q); @@ -110,7 +110,7 @@ namespace glm // -- Unary arithmetic operators -- - GLM_DEFAULTED_FUNC_DECL GLM_CONSTEXPR qua& operator=(qua const& q) GLM_DEFAULT; + GLM_DEFAULTED_FUNC_DECL GLM_CONSTEXPR qua& operator=(qua const& q) = default; template GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR qua& operator=(qua const& q); diff --git a/glm/detail/type_quat.inl b/glm/detail/type_quat.inl index 3cc43a6af..9b9c2100d 100644 --- a/glm/detail/type_quat.inl +++ b/glm/detail/type_quat.inl @@ -95,26 +95,13 @@ namespace detail // -- Implicit basic constructors -- -# if GLM_CONFIG_DEFAULTED_DEFAULT_CTOR == GLM_DISABLE +# if GLM_CONFIG_CTOR_INIT == GLM_ENABLE template GLM_DEFAULTED_DEFAULT_CTOR_QUALIFIER GLM_CONSTEXPR qua::qua() -# if GLM_CONFIG_CTOR_INIT != GLM_CTOR_INIT_DISABLE -# ifdef GLM_FORCE_QUAT_DATA_WXYZ - : w(1), x(0), y(0), z(0) -# else - : x(0), y(0), z(0), w(1) -# endif -# endif - {} -# endif - -# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE - template - GLM_DEFAULTED_FUNC_QUALIFIER GLM_CONSTEXPR qua::qua(qua const& q) # ifdef GLM_FORCE_QUAT_DATA_WXYZ - : w(q.w), x(q.x), y(q.y), z(q.z) + : w(1), x(0), y(0), z(0) # else - : x(q.x), y(q.y), z(q.z), w(q.w) + : x(0), y(0), z(0), w(1) # endif {} # endif @@ -254,18 +241,6 @@ namespace detail // -- Unary arithmetic operators -- -# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE - template - GLM_DEFAULTED_FUNC_QUALIFIER GLM_CONSTEXPR qua & qua::operator=(qua const& q) - { - this->w = q.w; - this->x = q.x; - this->y = q.y; - this->z = q.z; - return *this; - } -# endif - template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua & qua::operator=(qua const& q) diff --git a/glm/detail/type_vec1.hpp b/glm/detail/type_vec1.hpp index 0cc7b5d4c..830023f2e 100644 --- a/glm/detail/type_vec1.hpp +++ b/glm/detail/type_vec1.hpp @@ -93,7 +93,7 @@ namespace glm // -- Implicit basic constructors -- GLM_DEFAULTED_DEFAULT_CTOR_DECL GLM_CONSTEXPR vec() GLM_DEFAULT_CTOR; - GLM_DEFAULTED_FUNC_DECL GLM_CONSTEXPR vec(vec const& v) GLM_DEFAULT; + GLM_CTOR_DECL vec(vec<1, T, Q> const& v) = default; template GLM_CTOR_DECL vec(vec<1, T, P> const& v); @@ -129,7 +129,7 @@ namespace glm */ // -- Unary arithmetic operators -- - GLM_DEFAULTED_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator=(vec const& v) GLM_DEFAULT; + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<1, T, Q> & operator=(vec const& v) = default; template GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<1, T, Q> & operator=(vec<1, U, Q> const& v); diff --git a/glm/detail/type_vec1.inl b/glm/detail/type_vec1.inl index 18411e7f7..e0e1bbf5b 100644 --- a/glm/detail/type_vec1.inl +++ b/glm/detail/type_vec1.inl @@ -6,19 +6,10 @@ namespace glm { // -- Implicit basic constructors -- -# if GLM_CONFIG_DEFAULTED_DEFAULT_CTOR == GLM_DISABLE +# if GLM_CONFIG_CTOR_INIT == GLM_ENABLE template GLM_DEFAULTED_DEFAULT_CTOR_QUALIFIER GLM_CONSTEXPR vec<1, T, Q>::vec() -# if GLM_CONFIG_CTOR_INIT != GLM_CTOR_INIT_DISABLE - : x(0) -# endif - {} -# endif - -# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE - template - GLM_DEFAULTED_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q>::vec(vec<1, T, Q> const& v) - : x(v.x) + : x(0) {} # endif @@ -77,15 +68,6 @@ namespace glm // -- Unary arithmetic operators -- -# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE - template - GLM_DEFAULTED_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator=(vec<1, T, Q> const& v) - { - this->x = v.x; - return *this; - } -# endif - template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator=(vec<1, U, Q> const& v) diff --git a/glm/detail/type_vec2.hpp b/glm/detail/type_vec2.hpp index 66c6137ce..f9eb869d6 100644 --- a/glm/detail/type_vec2.hpp +++ b/glm/detail/type_vec2.hpp @@ -99,7 +99,7 @@ namespace glm // -- Implicit basic constructors -- GLM_DEFAULTED_DEFAULT_CTOR_DECL GLM_CONSTEXPR vec() GLM_DEFAULT_CTOR; - GLM_DEFAULTED_FUNC_DECL GLM_CONSTEXPR vec(vec const& v) GLM_DEFAULT; + GLM_CTOR_DECL vec(vec<2, T, Q> const& v) = default; template GLM_CTOR_DECL vec(vec<2, T, P> const& v); @@ -147,7 +147,7 @@ namespace glm // -- Unary arithmetic operators -- - GLM_DEFAULTED_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator=(vec const& v) GLM_DEFAULT; + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator=(vec const& v) = default; template GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<2, T, Q> & operator=(vec<2, U, Q> const& v); diff --git a/glm/detail/type_vec2.inl b/glm/detail/type_vec2.inl index e8408997f..ba88527d3 100644 --- a/glm/detail/type_vec2.inl +++ b/glm/detail/type_vec2.inl @@ -6,19 +6,10 @@ namespace glm { // -- Implicit basic constructors -- -# if GLM_CONFIG_DEFAULTED_DEFAULT_CTOR == GLM_DISABLE +# if GLM_CONFIG_CTOR_INIT == GLM_ENABLE template GLM_DEFAULTED_DEFAULT_CTOR_QUALIFIER GLM_CONSTEXPR vec<2, T, Q>::vec() -# if GLM_CONFIG_CTOR_INIT != GLM_CTOR_INIT_DISABLE - : x(0), y(0) -# endif - {} -# endif - -# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE - template - GLM_DEFAULTED_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q>::vec(vec<2, T, Q> const& v) - : x(v.x), y(v.y) + : x(0), y(0) {} # endif @@ -132,16 +123,6 @@ namespace glm // -- Unary arithmetic operators -- -# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE - template - GLM_DEFAULTED_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator=(vec<2, T, Q> const& v) - { - this->x = v.x; - this->y = v.y; - return *this; - } -# endif - template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator=(vec<2, U, Q> const& v) diff --git a/glm/detail/type_vec3.hpp b/glm/detail/type_vec3.hpp index 90de2f8a4..96cc8a40e 100644 --- a/glm/detail/type_vec3.hpp +++ b/glm/detail/type_vec3.hpp @@ -105,7 +105,7 @@ namespace glm // -- Implicit basic constructors -- GLM_DEFAULTED_DEFAULT_CTOR_DECL GLM_CONSTEXPR vec() GLM_DEFAULT_CTOR; - GLM_DEFAULTED_FUNC_DECL GLM_CONSTEXPR vec(vec const& v) GLM_DEFAULT; + GLM_CTOR_DECL vec(vec<3, T, Q> const& v) = default; template GLM_CTOR_DECL vec(vec<3, T, P> const& v); @@ -182,7 +182,7 @@ namespace glm // -- Unary arithmetic operators -- - GLM_DEFAULTED_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q>& operator=(vec<3, T, Q> const& v) GLM_DEFAULT; + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q>& operator=(vec<3, T, Q> const& v) = default; template GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<3, T, Q> & operator=(vec<3, U, Q> const& v); diff --git a/glm/detail/type_vec3.inl b/glm/detail/type_vec3.inl index 2bf65d866..d77a097e8 100644 --- a/glm/detail/type_vec3.inl +++ b/glm/detail/type_vec3.inl @@ -7,19 +7,10 @@ namespace glm { // -- Implicit basic constructors -- -# if GLM_CONFIG_DEFAULTED_DEFAULT_CTOR == GLM_DISABLE +# if GLM_CONFIG_CTOR_INIT == GLM_ENABLE template GLM_DEFAULTED_DEFAULT_CTOR_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec() -# if GLM_CONFIG_CTOR_INIT != GLM_CTOR_INIT_DISABLE - : x(0), y(0), z(0) -# endif - {} -# endif - -# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE - template - GLM_DEFAULTED_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(vec<3, T, Q> const& v) - : x(v.x), y(v.y), z(v.z) + : x(0), y(0), z(0) {} # endif @@ -201,17 +192,6 @@ namespace glm // -- Unary arithmetic operators -- -# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE - template - GLM_DEFAULTED_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>& vec<3, T, Q>::operator=(vec<3, T, Q> const& v) - { - this->x = v.x; - this->y = v.y; - this->z = v.z; - return *this; - } -# endif - template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>& vec<3, T, Q>::operator=(vec<3, U, Q> const& v) diff --git a/glm/detail/type_vec4.hpp b/glm/detail/type_vec4.hpp index 9ba11229f..79de5ecd7 100644 --- a/glm/detail/type_vec4.hpp +++ b/glm/detail/type_vec4.hpp @@ -103,7 +103,7 @@ namespace glm // -- Implicit basic constructors -- GLM_DEFAULTED_DEFAULT_CTOR_DECL GLM_CONSTEXPR vec() GLM_DEFAULT_CTOR; - GLM_DEFAULTED_FUNC_DECL GLM_CONSTEXPR vec(vec<4, T, Q> const& v) GLM_DEFAULT; + GLM_CTOR_DECL vec(vec<4, T, Q> const& v) = default; template GLM_CTOR_DECL vec(vec<4, T, P> const& v); @@ -254,7 +254,7 @@ namespace glm // -- Unary arithmetic operators -- - GLM_DEFAULTED_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q>& operator=(vec<4, T, Q> const& v) GLM_DEFAULT; + GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<4, T, Q>& operator=(vec<4, T, Q> const& v) = default; template GLM_FUNC_DISCARD_DECL GLM_CONSTEXPR vec<4, T, Q>& operator=(vec<4, U, Q> const& v); diff --git a/glm/detail/type_vec4.inl b/glm/detail/type_vec4.inl index 2d1ad558b..82b7b3f27 100644 --- a/glm/detail/type_vec4.inl +++ b/glm/detail/type_vec4.inl @@ -11,19 +11,10 @@ namespace detail // -- Implicit basic constructors -- -# if GLM_CONFIG_DEFAULTED_DEFAULT_CTOR == GLM_DISABLE +# if GLM_CONFIG_CTOR_INIT == GLM_ENABLE template GLM_DEFAULTED_DEFAULT_CTOR_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec() -# if GLM_CONFIG_CTOR_INIT != GLM_CTOR_INIT_DISABLE - : x(0), y(0), z(0), w(0) -# endif - {} -# endif - -# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE - template - GLM_DEFAULTED_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<4, T, Q> const& v) - : x(v.x), y(v.y), z(v.z), w(v.w) + : x(0), y(0), z(0), w(0) {} # endif @@ -396,18 +387,6 @@ namespace detail // -- Unary arithmetic operators -- -# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE - template - GLM_DEFAULTED_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>& vec<4, T, Q>::operator=(vec<4, T, Q> const& v) - { - this->x = v.x; - this->y = v.y; - this->z = v.z; - this->w = v.w; - return *this; - } -# endif - template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>& vec<4, T, Q>::operator=(vec<4, U, Q> const& v) diff --git a/glm/glm.cppm b/glm/glm.cppm index 94f86f913..9034a8ee4 100644 --- a/glm/glm.cppm +++ b/glm/glm.cppm @@ -16,7 +16,7 @@ export namespace glm { using glm::vec; using glm::mat; using glm::qua; -# if GLM_HAS_TEMPLATE_ALIASES + using glm::tvec1; using glm::tvec2; using glm::tvec3; @@ -31,7 +31,6 @@ export namespace glm { using glm::tmat4x3; using glm::tmat4x4; using glm::tquat; -# endif using glm::int8; using glm::int16; @@ -2210,10 +2209,8 @@ export namespace glm { # if !((GLM_COMPILER & GLM_COMPILER_CUDA) || (GLM_COMPILER & GLM_COMPILER_HIP)) using glm::to_string; # endif -# if GLM_HAS_TEMPLATE_ALIASES using glm::operator*; using glm::operator/; -# endif using glm::components; using glm::begin; using glm::end; diff --git a/glm/gtx/dual_quaternion.hpp b/glm/gtx/dual_quaternion.hpp index 04a60706e..718acc58f 100644 --- a/glm/gtx/dual_quaternion.hpp +++ b/glm/gtx/dual_quaternion.hpp @@ -54,8 +54,8 @@ namespace glm // -- Implicit basic constructors -- - GLM_DEFAULTED_FUNC_DECL GLM_CONSTEXPR tdualquat() GLM_DEFAULT; - GLM_DEFAULTED_FUNC_DECL GLM_CONSTEXPR tdualquat(tdualquat const& d) GLM_DEFAULT; + GLM_DEFAULTED_FUNC_DECL GLM_CONSTEXPR tdualquat() GLM_DEFAULT_CTOR; + GLM_CTOR_DECL tdualquat(tdualquat const& d) = default; template GLM_CTOR_DECL tdualquat(tdualquat const& d); @@ -75,7 +75,7 @@ namespace glm // -- Unary arithmetic operators -- - GLM_DEFAULTED_FUNC_DECL tdualquat & operator=(tdualquat const& m) GLM_DEFAULT; + GLM_DEFAULTED_FUNC_DECL tdualquat & operator=(tdualquat const& m) = default; template GLM_FUNC_DISCARD_DECL tdualquat & operator=(tdualquat const& m); diff --git a/glm/gtx/dual_quaternion.inl b/glm/gtx/dual_quaternion.inl index 3a04160e3..9433edaaf 100644 --- a/glm/gtx/dual_quaternion.inl +++ b/glm/gtx/dual_quaternion.inl @@ -23,19 +23,11 @@ namespace glm // -- Implicit basic constructors -- -# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE +# if GLM_CONFIG_CTOR_INIT == GLM_ENABLE template - GLM_DEFAULTED_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat::tdualquat() -# if GLM_CONFIG_DEFAULTED_FUNCTIONS != GLM_DISABLE + GLM_DEFAULTED_DEFAULT_CTOR_QUALIFIER GLM_CONSTEXPR tdualquat::tdualquat() : real(qua()) , dual(qua::wxyz(0, 0, 0, 0)) -# endif - {} - - template - GLM_DEFAULTED_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat::tdualquat(tdualquat const& d) - : real(d.real) - , dual(d.dual) {} # endif @@ -90,16 +82,6 @@ namespace glm // -- Unary arithmetic operators -- -# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE - template - GLM_DEFAULTED_FUNC_QUALIFIER tdualquat & tdualquat::operator=(tdualquat const& q) - { - this->real = q.real; - this->dual = q.dual; - return *this; - } -# endif - template template GLM_FUNC_QUALIFIER tdualquat & tdualquat::operator=(tdualquat const& q) diff --git a/glm/gtx/structured_bindings.hpp b/glm/gtx/structured_bindings.hpp index 2c39efd8f..fd193805a 100644 --- a/glm/gtx/structured_bindings.hpp +++ b/glm/gtx/structured_bindings.hpp @@ -78,14 +78,12 @@ namespace glm template GLM_FUNC_DECL GLM_CONSTEXPR T const& get(qua const& q); -#if GLM_HAS_RVALUE_REFERENCES template GLM_FUNC_DECL GLM_CONSTEXPR T get(vec const&& v); template GLM_FUNC_DECL GLM_CONSTEXPR vec get(mat const&& m); template GLM_FUNC_DECL GLM_CONSTEXPR T get(qua const&& q); -#endif /// @} }//namespace glm diff --git a/glm/gtx/structured_bindings.inl b/glm/gtx/structured_bindings.inl index 694f58396..971767b1f 100644 --- a/glm/gtx/structured_bindings.inl +++ b/glm/gtx/structured_bindings.inl @@ -33,7 +33,6 @@ namespace glm return q[I]; } -#if GLM_HAS_RVALUE_REFERENCES template GLM_CONSTEXPR T get(vec const&& v) { @@ -50,6 +49,5 @@ namespace glm static_assert(I < 4, "Index out of bounds"); return q[I]; } -#endif }//namespace glm diff --git a/test/core/core_cpp_constexpr.cpp b/test/core/core_cpp_constexpr.cpp index 3dc0a92bf..40d060ddc 100644 --- a/test/core/core_cpp_constexpr.cpp +++ b/test/core/core_cpp_constexpr.cpp @@ -1,7 +1,5 @@ #include -#if GLM_CONFIG_CONSTEXP == GLM_ENABLE - #include #include #include @@ -730,20 +728,16 @@ static int test_mat2x2() return Error; } -#endif//GLM_CONFIG_CONSTEXP == GLM_ENABLE - int main() { int Error = 0; -# if GLM_CONFIG_CONSTEXP == GLM_ENABLE - Error += test_vec1(); - Error += test_vec2(); - Error += test_vec3(); - Error += test_vec4(); - Error += test_quat(); - Error += test_mat2x2(); -# endif//GLM_CONFIG_CONSTEXP == GLM_ENABLE + Error += test_vec1(); + Error += test_vec2(); + Error += test_vec3(); + Error += test_vec4(); + Error += test_quat(); + Error += test_mat2x2(); return Error; } diff --git a/test/core/core_cpp_defaulted_ctor.cpp b/test/core/core_cpp_defaulted_ctor.cpp index 07afd9cd5..2c3b2304c 100644 --- a/test/core/core_cpp_defaulted_ctor.cpp +++ b/test/core/core_cpp_defaulted_ctor.cpp @@ -1,7 +1,5 @@ #include -#if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_ENABLE - #include #include #include @@ -128,17 +126,13 @@ static int test_quat_memcpy() return Error; } -#endif//GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_ENABLE - int main() { int Error = 0; -# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_ENABLE - Error += test_vec_memcpy(); - Error += test_mat_memcpy(); - Error += test_quat_memcpy(); -# endif//GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_ENABLE + Error += test_vec_memcpy(); + Error += test_mat_memcpy(); + Error += test_quat_memcpy(); return Error; } diff --git a/test/core/core_func_common.cpp b/test/core/core_func_common.cpp index 80691491b..c3db7d4cc 100644 --- a/test/core/core_func_common.cpp +++ b/test/core/core_func_common.cpp @@ -1374,7 +1374,6 @@ namespace ldexp_ static int test_constexpr() { -#if GLM_HAS_CONSTEXPR static_assert(glm::abs(1.0f) > 0.0f, "GLM: Failed constexpr"); constexpr glm::vec1 const A = glm::abs(glm::vec1(1.0f)); constexpr glm::vec2 const B = glm::abs(glm::vec2(1.0f)); @@ -1385,7 +1384,6 @@ static int test_constexpr() static_assert(glm::all(glm::equal(B, glm::vec2(1.0f), glm::epsilon())), "GLM: Failed constexpr"); static_assert(glm::all(glm::equal(C, glm::vec3(1.0f), glm::epsilon())), "GLM: Failed constexpr"); static_assert(glm::all(glm::equal(D, glm::vec4(1.0f), glm::epsilon())), "GLM: Failed constexpr"); -#endif // GLM_HAS_CONSTEXPR return 0; } diff --git a/test/core/core_type_ctor.cpp b/test/core/core_type_ctor.cpp index 078fcdf04..d4f3820ff 100644 --- a/test/core/core_type_ctor.cpp +++ b/test/core/core_type_ctor.cpp @@ -8,7 +8,6 @@ static int test_vec1_ctor() { int Error = 0; -# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_ENABLE { union pack { @@ -22,7 +21,6 @@ static int test_vec1_ctor() B.f = glm::vec1(1); Error += glm::all(glm::equal(B.i, glm::ivec1(1065353216))) ? 0 : 1; } -# endif//GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_ENABLE return Error; } @@ -31,7 +29,6 @@ static int test_vec2_ctor() { int Error = 0; -# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_ENABLE { union pack { @@ -45,7 +42,6 @@ static int test_vec2_ctor() B.f = glm::vec2(1); Error += glm::all(glm::equal(B.i, glm::ivec2(1065353216))) ? 0 : 1; } -# endif return Error; } @@ -54,7 +50,6 @@ static int test_vec3_ctor() { int Error = 0; -# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_ENABLE { union pack { @@ -68,7 +63,6 @@ static int test_vec3_ctor() B.f = glm::vec3(1); Error += glm::all(glm::equal(B.i, glm::ivec3(1065353216))) ? 0 : 1; } -# endif return Error; } @@ -77,7 +71,6 @@ static int test_vec4_ctor() { int Error = 0; -# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_ENABLE { union pack { @@ -91,7 +84,6 @@ static int test_vec4_ctor() B.f = glm::vec4(1); Error += glm::all(glm::equal(B.i, glm::ivec4(1065353216))) ? 0 : 1; } -# endif return Error; } @@ -100,7 +92,6 @@ static int test_mat2x2_ctor() { int Error = 0; -# if GLM_LANG & GLM_LANG_CXX11_FLAG { union pack { @@ -114,7 +105,6 @@ static int test_mat2x2_ctor() B.f = glm::mat2x2(1); Error += glm::all(glm::equal(B.i[0], glm::vec2(1, 0), glm::epsilon())) ? 0 : 1; } -# endif//GLM_LANG & GLM_LANG_CXX11_FLAG return Error; } @@ -123,7 +113,6 @@ static int test_mat2x3_ctor() { int Error = 0; -# if GLM_LANG & GLM_LANG_CXX11_FLAG { union pack { @@ -137,7 +126,6 @@ static int test_mat2x3_ctor() B.f = glm::mat2x3(1); Error += glm::all(glm::equal(B.i[0], glm::vec3(1, 0, 0), glm::epsilon())) ? 0 : 1; } -# endif//GLM_LANG & GLM_LANG_CXX11_FLAG return Error; } @@ -146,7 +134,6 @@ static int test_mat2x4_ctor() { int Error = 0; -# if GLM_LANG & GLM_LANG_CXX11_FLAG { union pack { @@ -162,7 +149,6 @@ static int test_mat2x4_ctor() glm::vec4 const D(1, 0, 0, 0); Error += glm::all(glm::equal(B.i[0], D, glm::epsilon())) ? 0 : 1; } -# endif//GLM_LANG & GLM_LANG_CXX11_FLAG return Error; } @@ -171,7 +157,6 @@ static int test_mat3x2_ctor() { int Error = 0; -# if GLM_LANG & GLM_LANG_CXX11_FLAG { union pack { @@ -185,7 +170,6 @@ static int test_mat3x2_ctor() B.f = glm::mat3x2(1); Error += glm::all(glm::equal(B.i[0], glm::vec2(1, 0), glm::epsilon())) ? 0 : 1; } -# endif//GLM_LANG & GLM_LANG_CXX11_FLAG return Error; } @@ -194,7 +178,6 @@ static int test_mat3x3_ctor() { int Error = 0; -# if GLM_LANG & GLM_LANG_CXX11_FLAG { union pack { @@ -208,7 +191,6 @@ static int test_mat3x3_ctor() B.f = glm::mat3x3(1); Error += glm::all(glm::equal(B.i[0], glm::vec3(1, 0, 0), glm::epsilon())) ? 0 : 1; } -# endif//GLM_LANG & GLM_LANG_CXX11_FLAG return Error; } @@ -217,7 +199,6 @@ static int test_mat3x4_ctor() { int Error = 0; -# if GLM_LANG & GLM_LANG_CXX11_FLAG { union pack { @@ -231,7 +212,6 @@ static int test_mat3x4_ctor() B.f = glm::mat3x4(1); Error += glm::all(glm::equal(B.i[0], glm::vec4(1, 0, 0, 0), glm::epsilon())) ? 0 : 1; } -# endif//GLM_LANG & GLM_LANG_CXX11_FLAG return Error; } @@ -240,7 +220,6 @@ static int test_mat4x2_ctor() { int Error = 0; -# if GLM_LANG & GLM_LANG_CXX11_FLAG { union pack { @@ -254,7 +233,6 @@ static int test_mat4x2_ctor() B.f = glm::mat4x2(1); Error += glm::all(glm::equal(B.i[0], glm::vec2(1, 0), glm::epsilon())) ? 0 : 1; } -# endif//GLM_LANG & GLM_LANG_CXX11_FLAG return Error; } @@ -263,7 +241,6 @@ static int test_mat4x3_ctor() { int Error = 0; -# if GLM_LANG & GLM_LANG_CXX11_FLAG { union pack { @@ -277,7 +254,6 @@ static int test_mat4x3_ctor() B.f = glm::mat4x3(1); Error += glm::all(glm::equal(B.i[0], glm::vec3(1, 0, 0), glm::epsilon())) ? 0 : 1; } -# endif//GLM_LANG & GLM_LANG_CXX11_FLAG return Error; } @@ -286,7 +262,6 @@ static int test_mat4x4_ctor() { int Error = 0; -# if GLM_LANG & GLM_LANG_CXX11_FLAG { union pack { @@ -300,7 +275,6 @@ static int test_mat4x4_ctor() B.f = glm::mat4(1); Error += glm::all(glm::equal(B.i[0], glm::vec4(1, 0, 0, 0), glm::epsilon())) ? 0 : 1; } -# endif//GLM_LANG & GLM_LANG_CXX11_FLAG return Error; } @@ -309,7 +283,6 @@ static int test_quat_ctor() { int Error = 0; -# if GLM_LANG & GLM_LANG_CXX11_FLAG { union pack { @@ -323,7 +296,6 @@ static int test_quat_ctor() B.f = glm::quat(1, 1, 1, 1); Error += glm::all(glm::equal(B.i, glm::quat(1, 1, 1, 1), glm::epsilon())) ? 0 : 1; } -# endif//GLM_LANG & GLM_LANG_CXX11_FLAG return Error; } diff --git a/test/core/core_type_mat2x2.cpp b/test/core/core_type_mat2x2.cpp index 061dcf272..cd4c37343 100644 --- a/test/core/core_type_mat2x2.cpp +++ b/test/core/core_type_mat2x2.cpp @@ -173,12 +173,10 @@ static int test_constexpr() { int Error = 0; -#if GLM_HAS_CONSTEXPR static_assert(glm::mat2x2::length() == 2, "GLM: Failed constexpr"); constexpr glm::mat2x2 const Z(1.0f); Error += glm::all(glm::equal(Z, glm::mat2x2(1.0f), glm::epsilon())) ? 0 : 1; -#endif return Error; } diff --git a/test/core/core_type_mat2x3.cpp b/test/core/core_type_mat2x3.cpp index ece32d4df..b763534fe 100644 --- a/test/core/core_type_mat2x3.cpp +++ b/test/core/core_type_mat2x3.cpp @@ -139,12 +139,10 @@ static int test_constexpr() { int Error = 0; -#if GLM_HAS_CONSTEXPR static_assert(glm::mat2x3::length() == 2, "GLM: Failed constexpr"); constexpr glm::mat2x3 const Z(1.0f); Error += glm::all(glm::equal(Z, glm::mat2x3(1.0f), glm::epsilon())) ? 0 : 1; -#endif return Error; } diff --git a/test/core/core_type_mat2x4.cpp b/test/core/core_type_mat2x4.cpp index 9ee0e1038..4d9b963f2 100644 --- a/test/core/core_type_mat2x4.cpp +++ b/test/core/core_type_mat2x4.cpp @@ -141,12 +141,10 @@ static int test_constexpr() { int Error = 0; -#if GLM_HAS_CONSTEXPR static_assert(glm::mat2x4::length() == 2, "GLM: Failed constexpr"); constexpr glm::mat2x4 const Z(1.0f); Error += glm::all(glm::equal(Z, glm::mat2x4(1.0f), glm::epsilon())) ? 0 : 1; -#endif return Error; } diff --git a/test/core/core_type_mat3x2.cpp b/test/core/core_type_mat3x2.cpp index bc50eca5f..bb1fd1d76 100644 --- a/test/core/core_type_mat3x2.cpp +++ b/test/core/core_type_mat3x2.cpp @@ -143,12 +143,10 @@ static int test_constexpr() { int Error = 0; -#if GLM_HAS_CONSTEXPR static_assert(glm::mat3x2::length() == 3, "GLM: Failed constexpr"); constexpr glm::mat3x2 const Z(1.0f); Error += glm::all(glm::equal(Z, glm::mat3x2(1.0f), glm::epsilon())) ? 0 : 1; -#endif return Error; } diff --git a/test/core/core_type_mat3x3.cpp b/test/core/core_type_mat3x3.cpp index 195596d83..cea7864a8 100644 --- a/test/core/core_type_mat3x3.cpp +++ b/test/core/core_type_mat3x3.cpp @@ -189,12 +189,10 @@ static int test_constexpr() { int Error = 0; -#if GLM_HAS_CONSTEXPR static_assert(glm::mat3x3::length() == 3, "GLM: Failed constexpr"); constexpr glm::mat3x3 const Z(1.0f); Error += glm::all(glm::equal(Z, glm::mat3x3(1.0f), glm::epsilon())) ? 0 : 1; -#endif return Error; } diff --git a/test/core/core_type_mat3x4.cpp b/test/core/core_type_mat3x4.cpp index b525397da..02735db66 100644 --- a/test/core/core_type_mat3x4.cpp +++ b/test/core/core_type_mat3x4.cpp @@ -145,12 +145,10 @@ static int test_constexpr() { int Error = 0; -#if GLM_HAS_CONSTEXPR static_assert(glm::mat3x4::length() == 3, "GLM: Failed constexpr"); constexpr glm::mat3x4 const Z(1.0f); Error += glm::all(glm::equal(Z, glm::mat3x4(1.0f), glm::epsilon())) ? 0 : 1; -#endif return Error; } diff --git a/test/core/core_type_mat4x2.cpp b/test/core/core_type_mat4x2.cpp index c5614e9d0..ab4d299fe 100644 --- a/test/core/core_type_mat4x2.cpp +++ b/test/core/core_type_mat4x2.cpp @@ -147,12 +147,10 @@ static int test_constexpr() { int Error = 0; -#if GLM_HAS_CONSTEXPR static_assert(glm::mat4x2::length() == 4, "GLM: Failed constexpr"); constexpr glm::mat4x2 const Z(1.0f); Error += glm::all(glm::equal(Z, glm::mat4x2(1.0f), glm::epsilon())) ? 0 : 1; -#endif return Error; } diff --git a/test/core/core_type_mat4x3.cpp b/test/core/core_type_mat4x3.cpp index 816b52990..9a81800d5 100644 --- a/test/core/core_type_mat4x3.cpp +++ b/test/core/core_type_mat4x3.cpp @@ -147,12 +147,10 @@ static int test_constexpr() { int Error = 0; -#if GLM_HAS_CONSTEXPR static_assert(glm::mat4x3::length() == 4, "GLM: Failed constexpr"); constexpr glm::mat4x3 const Z(1.0f); Error += glm::all(glm::equal(Z, glm::mat4x3(1.0f), glm::epsilon())) ? 0 : 1; -#endif return Error; } diff --git a/test/core/core_type_mat4x4.cpp b/test/core/core_type_mat4x4.cpp index 4ce7bb40e..0296bc02c 100644 --- a/test/core/core_type_mat4x4.cpp +++ b/test/core/core_type_mat4x4.cpp @@ -173,7 +173,6 @@ static int test_constexpr() { int Error = 0; -#if GLM_HAS_CONSTEXPR static_assert(glm::mat4::length() == 4, "GLM: Failed constexpr"); constexpr glm::mat4 A(1.f); constexpr glm::mat4 B(1.f); @@ -182,7 +181,6 @@ static int test_constexpr() constexpr glm::mat4 const Z(1.0f); Error += glm::all(glm::equal(Z, glm::mat4(1.0f), glm::epsilon())) ? 0 : 1; -#endif return Error; } diff --git a/test/core/core_type_vec1.cpp b/test/core/core_type_vec1.cpp index 6542c7137..e83b7f8bc 100644 --- a/test/core/core_type_vec1.cpp +++ b/test/core/core_type_vec1.cpp @@ -166,10 +166,8 @@ static int test_swizzle() static int test_constexpr() { -#if GLM_HAS_CONSTEXPR static_assert(glm::vec1::length() == 1, "GLM: Failed constexpr"); static_assert(glm::vec1(1.0f).x > 0.0f, "GLM: Failed constexpr"); -#endif return 0; } diff --git a/test/core/core_type_vec2.cpp b/test/core/core_type_vec2.cpp index 46099722f..b33ca0722 100644 --- a/test/core/core_type_vec2.cpp +++ b/test/core/core_type_vec2.cpp @@ -365,12 +365,10 @@ static int test_operator_increment() static int test_constexpr() { -#if GLM_HAS_CONSTEXPR static_assert(glm::vec2::length() == 2, "GLM: Failed constexpr"); static_assert(glm::vec2(1.0f).x > 0.0f, "GLM: Failed constexpr"); static_assert(glm::vec2(1.0f, -1.0f).x > 0.0f, "GLM: Failed constexpr"); static_assert(glm::vec2(1.0f, -1.0f).y < 0.0f, "GLM: Failed constexpr"); -#endif return 0; } diff --git a/test/core/core_type_vec3.cpp b/test/core/core_type_vec3.cpp index e4ac1f2a8..ab3979a71 100644 --- a/test/core/core_type_vec3.cpp +++ b/test/core/core_type_vec3.cpp @@ -612,12 +612,10 @@ static int test_swizzle() static int test_constexpr() { -#if GLM_HAS_CONSTEXPR static_assert(glm::vec3::length() == 3, "GLM: Failed constexpr"); static_assert(glm::vec3(1.0f).x > 0.0f, "GLM: Failed constexpr"); static_assert(glm::vec3(1.0f, -1.0f, -1.0f).x > 0.0f, "GLM: Failed constexpr"); static_assert(glm::vec3(1.0f, -1.0f, -1.0f).y < 0.0f, "GLM: Failed constexpr"); -#endif return 0; } diff --git a/test/core/core_type_vec4.cpp b/test/core/core_type_vec4.cpp index 4b6c599bc..22eaab5ad 100644 --- a/test/core/core_type_vec4.cpp +++ b/test/core/core_type_vec4.cpp @@ -753,12 +753,10 @@ static int test_inheritance() static int test_constexpr() { -#if GLM_HAS_CONSTEXPR static_assert(glm::vec4::length() == 4, "GLM: Failed constexpr"); static_assert(glm::vec4(1.0f).x > 0.0f, "GLM: Failed constexpr"); static_assert(glm::vec4(1.0f, -1.0f, -1.0f, -1.0f).x > 0.0f, "GLM: Failed constexpr"); static_assert(glm::vec4(1.0f, -1.0f, -1.0f, -1.0f).y < 0.0f, "GLM: Failed constexpr"); -#endif return 0; } diff --git a/test/ext/ext_quaternion_type.cpp b/test/ext/ext_quaternion_type.cpp index 900e364da..43169423e 100644 --- a/test/ext/ext_quaternion_type.cpp +++ b/test/ext/ext_quaternion_type.cpp @@ -91,10 +91,8 @@ static int test_precision() static int test_constexpr() { -#if GLM_HAS_CONSTEXPR static_assert(glm::quat::length() == 4, "GLM: Failed constexpr"); static_assert(glm::quat(1.0f, glm::vec3(0.0f)).w > 0.0f, "GLM: Failed constexpr"); -#endif return 0; } diff --git a/test/ext/ext_scalar_relational.cpp b/test/ext/ext_scalar_relational.cpp index 61f1999aa..9afbd8c30 100644 --- a/test/ext/ext_scalar_relational.cpp +++ b/test/ext/ext_scalar_relational.cpp @@ -5,10 +5,8 @@ static int test_equal_epsilon() { -# if GLM_CONFIG_CONSTEXP == GLM_ENABLE - static_assert(glm::equal(1.01f, 1.02f, 0.1f), "GLM: Failed constexpr"); - static_assert(!glm::equal(1.01f, 1.02f, 0.001f), "GLM: Failed constexpr"); -# endif + static_assert(glm::equal(1.01f, 1.02f, 0.1f), "GLM: Failed constexpr"); + static_assert(!glm::equal(1.01f, 1.02f, 0.001f), "GLM: Failed constexpr"); int Error = 0; @@ -20,10 +18,8 @@ static int test_equal_epsilon() static int test_notEqual_epsilon() { -# if GLM_CONFIG_CONSTEXP == GLM_ENABLE - static_assert(glm::notEqual(1.01f, 1.02f, 0.001f), "GLM: Failed constexpr"); - static_assert(!glm::notEqual(1.01f, 1.02f, 0.1f), "GLM: Failed constexpr"); -# endif + static_assert(glm::notEqual(1.01f, 1.02f, 0.001f), "GLM: Failed constexpr"); + static_assert(!glm::notEqual(1.01f, 1.02f, 0.1f), "GLM: Failed constexpr"); int Error = 0; diff --git a/test/ext/ext_vec1.cpp b/test/ext/ext_vec1.cpp index c1fa1282f..6b1f827d6 100644 --- a/test/ext/ext_vec1.cpp +++ b/test/ext/ext_vec1.cpp @@ -143,10 +143,8 @@ static int test_bvec1_ctor() static int test_constexpr() { -#if GLM_HAS_CONSTEXPR static_assert(glm::vec1::length() == 1, "GLM: Failed constexpr"); static_assert(glm::vec1(1.0f).x > 0.0f, "GLM: Failed constexpr"); -#endif return 0; } diff --git a/test/ext/ext_vector_bool1.cpp b/test/ext/ext_vector_bool1.cpp index 43eed57b1..45dfa0436 100644 --- a/test/ext/ext_vector_bool1.cpp +++ b/test/ext/ext_vector_bool1.cpp @@ -64,9 +64,7 @@ static int test_relational() template static int test_constexpr() { -# if GLM_HAS_CONSTEXPR - static_assert(genType::length() == 1, "GLM: Failed constexpr"); -# endif + static_assert(genType::length() == 1, "GLM: Failed constexpr"); return 0; } diff --git a/test/ext/ext_vector_iec559.cpp b/test/ext/ext_vector_iec559.cpp index 5a9da5069..20edcfc27 100644 --- a/test/ext/ext_vector_iec559.cpp +++ b/test/ext/ext_vector_iec559.cpp @@ -101,9 +101,7 @@ static int test_relational() template static int test_constexpr() { -# if GLM_CONFIG_CONSTEXP == GLM_ENABLE - static_assert(genType::length() == 1, "GLM: Failed constexpr"); -# endif + static_assert(genType::length() == 1, "GLM: Failed constexpr"); return 0; } diff --git a/test/ext/ext_vector_integer_sized.cpp b/test/ext/ext_vector_integer_sized.cpp index 1f93d19f0..ab53598d0 100644 --- a/test/ext/ext_vector_integer_sized.cpp +++ b/test/ext/ext_vector_integer_sized.cpp @@ -137,12 +137,10 @@ static int test_relational() template static int test_constexpr() { -# if GLM_CONFIG_CONSTEXP == GLM_ENABLE - static_assert(genType::length() == 1, "GLM: Failed constexpr"); - static_assert(genType(1)[0] == 1, "GLM: Failed constexpr"); - static_assert(genType(1) == genType(1), "GLM: Failed constexpr"); - static_assert(genType(1) != genType(0), "GLM: Failed constexpr"); -# endif + static_assert(genType::length() == 1, "GLM: Failed constexpr"); + static_assert(genType(1)[0] == 1, "GLM: Failed constexpr"); + static_assert(genType(1) == genType(1), "GLM: Failed constexpr"); + static_assert(genType(1) != genType(0), "GLM: Failed constexpr"); return 0; } diff --git a/test/ext/ext_vector_relational.cpp b/test/ext/ext_vector_relational.cpp index f6cd30714..0f7f99e62 100644 --- a/test/ext/ext_vector_relational.cpp +++ b/test/ext/ext_vector_relational.cpp @@ -62,9 +62,7 @@ static int test_notEqual() template static int test_constexpr() { -# if GLM_CONFIG_CONSTEXP == GLM_ENABLE - static_assert(glm::all(glm::equal(genType(static_cast(1.01f)), genType(static_cast(1.02f)), static_cast(0.1f))), "GLM: Failed constexpr"); -# endif + static_assert(glm::all(glm::equal(genType(static_cast(1.01f)), genType(static_cast(1.02f)), static_cast(0.1f))), "GLM: Failed constexpr"); return 0; } diff --git a/test/gtc/gtc_type_aligned.cpp b/test/gtc/gtc_type_aligned.cpp index b7f9ce727..84c7f20f3 100644 --- a/test/gtc/gtc_type_aligned.cpp +++ b/test/gtc/gtc_type_aligned.cpp @@ -135,18 +135,14 @@ static int test_copy_vec4() { glm::aligned_ivec4 const u(1, 2, 3, 4); glm::packed_ivec4 const v(u); - Error += v.x == u.x ? 0 : 1; - Error += v.y == u.y ? 0 : 1; - Error += v.z == u.z ? 0 : 1; - Error += v.w == u.w ? 0 : 1; + glm::aligned_ivec4 const w(v); + Error += glm::all(glm::equal(u, w)) ? 0 : 1; } { glm::packed_ivec4 const u(1, 2, 3, 4); glm::aligned_ivec4 const v(u); - Error += v.x == u.x ? 0 : 1; - Error += v.y == u.y ? 0 : 1; - Error += v.z == u.z ? 0 : 1; - Error += v.w == u.w ? 0 : 1; + glm::packed_ivec4 const w(v); + Error += glm::all(glm::equal(u, w)) ? 0 : 1; } return Error; @@ -188,16 +184,14 @@ static int test_copy_vec3() { glm::aligned_ivec3 const u(1, 2, 3); glm::packed_ivec3 const v(u); - Error += v.x == u.x ? 0 : 1; - Error += v.y == u.y ? 0 : 1; - Error += v.z == u.z ? 0 : 1; + glm::aligned_ivec3 const w(v); + Error += glm::all(glm::equal(u, w)) ? 0 : 1; } { glm::packed_ivec3 const u(1, 2, 3); glm::aligned_ivec3 const v(u); - Error += v.x == u.x ? 0 : 1; - Error += v.y == u.y ? 0 : 1; - Error += v.z == u.z ? 0 : 1; + glm::packed_ivec3 const w(v); + Error += glm::all(glm::equal(u, w)) ? 0 : 1; } return Error; @@ -439,10 +433,9 @@ static int test_copy() { glm::aligned_ivec4 const a(1, 2, 3, 4); glm::ivec4 const u(a); - Error += a.x == u.x ? 0 : 1; - Error += a.y == u.y ? 0 : 1; - Error += a.z == u.z ? 0 : 1; - Error += a.w == u.w ? 0 : 1; + glm::aligned_ivec4 const v(u); + + Error += glm::all(glm::equal(a, v)) ? 0 : 1; } { @@ -465,34 +458,29 @@ static int test_ctor() { int Error = 0; -# if GLM_HAS_CONSTEXPR { constexpr glm::aligned_ivec4 v(1); - - Error += v.x == 1 ? 0 : 1; - Error += v.y == 1 ? 0 : 1; - Error += v.z == 1 ? 0 : 1; - Error += v.w == 1 ? 0 : 1; + static_assert(v.x == 1); + static_assert(v.y == 1); + static_assert(v.z == 1); + static_assert(v.w == 1); } { constexpr glm::packed_ivec4 v(1); - - Error += v.x == 1 ? 0 : 1; - Error += v.y == 1 ? 0 : 1; - Error += v.z == 1 ? 0 : 1; - Error += v.w == 1 ? 0 : 1; + static_assert(v.x == 1); + static_assert(v.y == 1); + static_assert(v.z == 1); + static_assert(v.w == 1); } { constexpr glm::ivec4 v(1); - - Error += v.x == 1 ? 0 : 1; - Error += v.y == 1 ? 0 : 1; - Error += v.z == 1 ? 0 : 1; - Error += v.w == 1 ? 0 : 1; + static_assert(v.x == 1); + static_assert(v.y == 1); + static_assert(v.z == 1); + static_assert(v.w == 1); } -# endif//GLM_HAS_CONSTEXPR return Error; } diff --git a/test/gtx/gtx_scalar_multiplication.cpp b/test/gtx/gtx_scalar_multiplication.cpp index de222e55a..ca7f0b530 100644 --- a/test/gtx/gtx_scalar_multiplication.cpp +++ b/test/gtx/gtx_scalar_multiplication.cpp @@ -2,7 +2,7 @@ #include #include -#if GLM_HAS_TEMPLATE_ALIASES && !(GLM_COMPILER & GLM_COMPILER_GCC) +#if !(GLM_COMPILER & GLM_COMPILER_GCC) #define GLM_ENABLE_EXPERIMENTAL #include