mirror of
https://github.com/g-truc/glm.git
synced 2024-11-16 14:54:35 +00:00
Convert non-simd vec const operator[] to constexpr
This commit is contained in:
parent
5ba45d302c
commit
7e80fa1d65
@ -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];
|
||||||
|
@ -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 --
|
||||||
|
|
||||||
|
@ -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];
|
||||||
|
@ -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 --
|
||||||
|
|
||||||
|
@ -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];
|
||||||
|
@ -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 --
|
||||||
|
|
||||||
|
@ -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];
|
||||||
|
@ -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 --
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user