diff --git a/glm/detail/type_vec3.hpp b/glm/detail/type_vec3.hpp index 158086bb..60a59f28 100644 --- a/glm/detail/type_vec3.hpp +++ b/glm/detail/type_vec3.hpp @@ -406,7 +406,7 @@ namespace glm // -- Boolean operators -- template - GLM_FUNC_DECL bool operator==(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); + GLM_FUNC_DECL GLM_CONSTEXPR_CXX11 bool operator==(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); template GLM_FUNC_DECL bool operator!=(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); diff --git a/glm/detail/type_vec3.inl b/glm/detail/type_vec3.inl index f448183a..3a06eca0 100644 --- a/glm/detail/type_vec3.inl +++ b/glm/detail/type_vec3.inl @@ -1021,12 +1021,15 @@ namespace glm // -- Boolean operators -- template - GLM_FUNC_QUALIFIER bool operator==(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX11 bool operator==(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) { + return v1.x == v2.x && v1.y == v2.y && v1.z == v2.z; +/* return detail::compute_equal::call(v1.x, v2.x) && detail::compute_equal::call(v1.y, v2.y) && detail::compute_equal::call(v1.z, v2.z); +*/ } template diff --git a/test/core/core_type_mat4x4.cpp b/test/core/core_type_mat4x4.cpp index a42dd048..33265d4a 100644 --- a/test/core/core_type_mat4x4.cpp +++ b/test/core/core_type_mat4x4.cpp @@ -321,6 +321,8 @@ static int test_size() static int test_constexpr() { + glm::mat4 const I(1.0f); + #if GLM_HAS_CONSTEXPR_CXX11 static_assert(glm::mat4::length() == 4, "GLM: Failed constexpr"); #endif diff --git a/test/core/core_type_vec3.cpp b/test/core/core_type_vec3.cpp index 7e44d23d..58413164 100644 --- a/test/core/core_type_vec3.cpp +++ b/test/core/core_type_vec3.cpp @@ -563,6 +563,7 @@ static int test_constexpr() #if GLM_HAS_CONSTEXPR_CXX11 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) == glm::vec3(1.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 diff --git a/test/core/core_type_vec4.cpp b/test/core/core_type_vec4.cpp index 8fef3289..7729da58 100644 --- a/test/core/core_type_vec4.cpp +++ b/test/core/core_type_vec4.cpp @@ -714,6 +714,7 @@ static int test_constexpr() #if GLM_HAS_CONSTEXPR_CXX11 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) == glm::vec4(1.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