Convert non-simd vec const operator[] to constexpr

This commit is contained in:
Nabil M 2018-04-15 14:34:37 -02:30
parent 5ba45d302c
commit 7e80fa1d65
8 changed files with 8 additions and 8 deletions

View File

@ -70,7 +70,7 @@ namespace glm
} }
template<typename T, qualifier Q> template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER T const& vec<1, T, Q>::operator[](typename vec<1, T, Q>::length_type i) const GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 T const& vec<1, T, Q>::operator[](typename vec<1, T, Q>::length_type i) const
{ {
assert(i >= 0 && i < this->length()); assert(i >= 0 && i < this->length());
return (&x)[i]; return (&x)[i];

View File

@ -82,7 +82,7 @@ namespace glm
GLM_FUNC_DECL static GLM_CONSTEXPR length_type length(){return 2;} GLM_FUNC_DECL static GLM_CONSTEXPR length_type length(){return 2;}
GLM_FUNC_DECL T& operator[](length_type i); GLM_FUNC_DECL T& operator[](length_type i);
GLM_FUNC_DECL T const& operator[](length_type i) const; GLM_FUNC_DECL GLM_CONSTEXPR_CXX14 T const& operator[](length_type i) const;
// -- Implicit basic constructors -- // -- Implicit basic constructors --

View File

@ -88,7 +88,7 @@ namespace glm
} }
template<typename T, qualifier Q> template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER T const& vec<2, T, Q>::operator[](typename vec<2, T, Q>::length_type i) const GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 T const& vec<2, T, Q>::operator[](typename vec<2, T, Q>::length_type i) const
{ {
assert(i >= 0 && i < this->length()); assert(i >= 0 && i < this->length());
return (&x)[i]; return (&x)[i];

View File

@ -82,7 +82,7 @@ namespace glm
GLM_FUNC_DECL static GLM_CONSTEXPR length_type length(){return 3;} GLM_FUNC_DECL static GLM_CONSTEXPR length_type length(){return 3;}
GLM_FUNC_DECL T & operator[](length_type i); GLM_FUNC_DECL T & operator[](length_type i);
GLM_FUNC_DECL T const& operator[](length_type i) const; GLM_FUNC_DECL GLM_CONSTEXPR_CXX14 T const& operator[](length_type i) const;
// -- Implicit basic constructors -- // -- Implicit basic constructors --

View File

@ -117,7 +117,7 @@ namespace glm
} }
template<typename T, qualifier Q> template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER T const& vec<3, T, Q>::operator[](typename vec<3, T, Q>::length_type i) const GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 T const& vec<3, T, Q>::operator[](typename vec<3, T, Q>::length_type i) const
{ {
assert(i >= 0 && i < this->length()); assert(i >= 0 && i < this->length());
return (&x)[i]; return (&x)[i];

View File

@ -85,7 +85,7 @@ namespace glm
GLM_FUNC_DECL static GLM_CONSTEXPR length_type length(){return 4;} GLM_FUNC_DECL static GLM_CONSTEXPR length_type length(){return 4;}
GLM_FUNC_DECL T & operator[](length_type i); GLM_FUNC_DECL T & operator[](length_type i);
GLM_FUNC_DECL T const& operator[](length_type i) const; GLM_FUNC_DECL GLM_CONSTEXPR_CXX14 T const& operator[](length_type i) const;
// -- Implicit basic constructors -- // -- Implicit basic constructors --

View File

@ -332,7 +332,7 @@ namespace detail
} }
template<typename T, qualifier Q> template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER T const& vec<4, T, Q>::operator[](typename vec<4, T, Q>::length_type i) const GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CXX14 T const& vec<4, T, Q>::operator[](typename vec<4, T, Q>::length_type i) const
{ {
assert(i >= 0 && i < this->length()); assert(i >= 0 && i < this->length());
return (&x)[i]; return (&x)[i];

View File

@ -97,7 +97,7 @@ namespace glm
GLM_FUNC_DECL static GLM_CONSTEXPR length_type length(){return 1;} GLM_FUNC_DECL static GLM_CONSTEXPR length_type length(){return 1;}
GLM_FUNC_DECL T & operator[](length_type i); GLM_FUNC_DECL T & operator[](length_type i);
GLM_FUNC_DECL T const& operator[](length_type i) const; GLM_FUNC_DECL GLM_CONSTEXPR_CXX14 T const& operator[](length_type i) const;
// -- Implicit basic constructors -- // -- Implicit basic constructors --