diff --git a/glm/detail/type_vec4.hpp b/glm/detail/type_vec4.hpp index 12eedd83..c3923b4a 100644 --- a/glm/detail/type_vec4.hpp +++ b/glm/detail/type_vec4.hpp @@ -79,7 +79,7 @@ namespace glm /// Return the count of components of the vector 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 const & operator[](length_type i) const; diff --git a/glm/detail/type_vec4.inl b/glm/detail/type_vec4.inl index 6b4532ad..2377e2b1 100644 --- a/glm/detail/type_vec4.inl +++ b/glm/detail/type_vec4.inl @@ -324,12 +324,6 @@ namespace detail // -- Component accesses -- - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename tvec4::length_type tvec4::length() const - { - return 4; - } - template GLM_FUNC_QUALIFIER T & tvec4::operator[](typename tvec4::length_type i) { diff --git a/glm/gtc/random.inl b/glm/gtc/random.inl index 7dc5e836..ad5926ee 100644 --- a/glm/gtc/random.inl +++ b/glm/gtc/random.inl @@ -154,7 +154,7 @@ namespace detail return (compute_rand::call() % (Max + static_cast(1) - Min)) + Min; } }; - + template class vecType> struct compute_linearRand { diff --git a/test/core/core_func_noise.cpp b/test/core/core_func_noise.cpp index 41db681f..2bbf3fb3 100644 --- a/test/core/core_func_noise.cpp +++ b/test/core/core_func_noise.cpp @@ -1,7 +1,22 @@ +struct vec4 +{ + static int length(); +}; + +int vec4::length() +{ + return 4; +} + int main() { int Failed = 0; - + + vec4 V; + + int LengthA = V.length(); + int LengthB = vec4::length(); + return Failed; }