More constexpr test
This commit is contained in:
@@ -30,7 +30,7 @@ namespace glm
|
|||||||
GLM_FUNC_DECL static GLM_CONSTEXPR_CXX11 length_type length() { return 3; }
|
GLM_FUNC_DECL static GLM_CONSTEXPR_CXX11 length_type length() { return 3; }
|
||||||
|
|
||||||
GLM_FUNC_DECL col_type & operator[](length_type i);
|
GLM_FUNC_DECL col_type & operator[](length_type i);
|
||||||
GLM_FUNC_DECL col_type const& operator[](length_type i) const;
|
GLM_FUNC_DECL GLM_CONSTEXPR_CXX11 col_type const& operator[](length_type i) const;
|
||||||
|
|
||||||
// -- Constructors --
|
// -- Constructors --
|
||||||
|
|
||||||
@@ -175,7 +175,7 @@ namespace glm
|
|||||||
// -- Boolean operators --
|
// -- Boolean operators --
|
||||||
|
|
||||||
template<typename T, qualifier Q>
|
template<typename T, qualifier Q>
|
||||||
GLM_FUNC_DECL bool operator==(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2);
|
GLM_FUNC_DECL GLM_CONSTEXPR_CXX11 bool operator==(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2);
|
||||||
|
|
||||||
template<typename T, qualifier Q>
|
template<typename T, qualifier Q>
|
||||||
GLM_FUNC_DECL bool operator!=(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2);
|
GLM_FUNC_DECL bool operator!=(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2);
|
||||||
|
|||||||
@@ -248,7 +248,7 @@ namespace glm
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<typename T, qualifier Q>
|
template<typename T, qualifier Q>
|
||||||
GLM_FUNC_QUALIFIER typename mat<3, 3, T, Q>::col_type const& mat<3, 3, T, Q>::operator[](typename mat<3, 3, T, Q>::length_type i) const
|
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX11 typename mat<3, 3, T, Q>::col_type const& mat<3, 3, T, Q>::operator[](typename mat<3, 3, T, Q>::length_type i) const
|
||||||
{
|
{
|
||||||
assert(i < this->length());
|
assert(i < this->length());
|
||||||
return this->value[i];
|
return this->value[i];
|
||||||
@@ -591,7 +591,7 @@ namespace glm
|
|||||||
// -- Boolean operators --
|
// -- Boolean operators --
|
||||||
|
|
||||||
template<typename T, qualifier Q>
|
template<typename T, qualifier Q>
|
||||||
GLM_FUNC_QUALIFIER bool operator==(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2)
|
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX11 bool operator==(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2)
|
||||||
{
|
{
|
||||||
return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]);
|
return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -187,6 +187,10 @@ static int test_constexpr()
|
|||||||
{
|
{
|
||||||
#if GLM_HAS_CONSTEXPR_CXX11
|
#if GLM_HAS_CONSTEXPR_CXX11
|
||||||
static_assert(glm::mat3x3::length() == 3, "GLM: Failed constexpr");
|
static_assert(glm::mat3x3::length() == 3, "GLM: Failed constexpr");
|
||||||
|
|
||||||
|
GLM_CONSTEXPR_CXX11 glm::mat3x3 const Z(0.0f);
|
||||||
|
static_assert(Z[0] == glm::vec3(0.0f), "GLM: Failed constexpr");
|
||||||
|
static_assert(Z == glm::mat3x3(0.0f), "GLM: Failed constexpr");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user