mirror of
https://github.com/g-truc/glm.git
synced 2024-11-29 19:34:36 +00:00
length becomes a static function #565
This commit is contained in:
parent
e98ce44d85
commit
9298939816
@ -79,7 +79,7 @@ namespace glm
|
|||||||
|
|
||||||
/// Return the count of components of the vector
|
/// Return the count of components of the vector
|
||||||
typedef length_t length_type;
|
typedef length_t length_type;
|
||||||
GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const;
|
GLM_FUNC_DECL static 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 T const & operator[](length_type i) const;
|
||||||
|
@ -324,12 +324,6 @@ namespace detail
|
|||||||
|
|
||||||
// -- Component accesses --
|
// -- Component accesses --
|
||||||
|
|
||||||
template <typename T, precision P>
|
|
||||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tvec4<T, P>::length_type tvec4<T, P>::length() const
|
|
||||||
{
|
|
||||||
return 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename T, precision P>
|
template <typename T, precision P>
|
||||||
GLM_FUNC_QUALIFIER T & tvec4<T, P>::operator[](typename tvec4<T, P>::length_type i)
|
GLM_FUNC_QUALIFIER T & tvec4<T, P>::operator[](typename tvec4<T, P>::length_type i)
|
||||||
{
|
{
|
||||||
|
@ -1,7 +1,22 @@
|
|||||||
|
struct vec4
|
||||||
|
{
|
||||||
|
static int length();
|
||||||
|
};
|
||||||
|
|
||||||
|
int vec4::length()
|
||||||
|
{
|
||||||
|
return 4;
|
||||||
|
}
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
int Failed = 0;
|
int Failed = 0;
|
||||||
|
|
||||||
|
vec4 V;
|
||||||
|
|
||||||
|
int LengthA = V.length();
|
||||||
|
int LengthB = vec4::length();
|
||||||
|
|
||||||
return Failed;
|
return Failed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user