diff --git a/glm/core/_detail.hpp b/glm/core/_detail.hpp index b902dc44..5ba760eb 100644 --- a/glm/core/_detail.hpp +++ b/glm/core/_detail.hpp @@ -250,16 +250,16 @@ namespace detail{ }; }; -#define GLM_DETAIL_IS_VECTOR(T) \ - template <> \ - struct is_vector \ - { \ - enum is_vector_enum \ - { \ - _YES = 1, \ - _NO = 0 \ - }; \ - } +# define GLM_DETAIL_IS_VECTOR(TYPE) \ + template \ + struct is_vector > \ + { \ + enum is_vector_enum \ + { \ + _YES = 1, \ + _NO = 0 \ + }; \ + }; ////////////////// // matrix diff --git a/glm/core/func_vector_relational.hpp b/glm/core/func_vector_relational.hpp index f9431c9a..6cecf195 100644 --- a/glm/core/func_vector_relational.hpp +++ b/glm/core/func_vector_relational.hpp @@ -10,6 +10,8 @@ #ifndef glm_core_func_vector_relational #define glm_core_func_vector_relational +#include "_detail.hpp" + namespace glm { namespace test{ @@ -31,10 +33,11 @@ namespace glm vecType const & y ) { - GLM_STATIC_ASSERT( + GLM_STATIC_ASSERT(( detail::type::is_float || detail::type::is_int || - detail::type::is_uint, "'lessThan' only accept numbers"); + detail::type::is_uint) && detail::is_vector >::_YES, + "'lessThan' only accept numbers"); typename vecType::bool_type Result(vecType::null); for(typename vecType::size_type i = 0; i < vecType::value_size(); ++i) @@ -51,10 +54,11 @@ namespace glm vecType const & y ) { - GLM_STATIC_ASSERT( + GLM_STATIC_ASSERT(( detail::type::is_float || detail::type::is_int || - detail::type::is_uint, "'lessThanEqual' only accept numbers"); + detail::type::is_uint) && detail::is_vector >::_YES, + "'lessThanEqual' only accept numbers"); typename vecType::bool_type Result(vecType::null); for(typename vecType::size_type i = 0; i < vecType::value_size(); ++i) @@ -71,10 +75,11 @@ namespace glm vecType const & y ) { - GLM_STATIC_ASSERT( + GLM_STATIC_ASSERT(( detail::type::is_float || detail::type::is_int || - detail::type::is_uint, "'greaterThan' only accept numbers"); + detail::type::is_uint) && detail::is_vector >::_YES, + "'greaterThan' only accept numbers"); typename vecType::bool_type Result(vecType::null); for(typename vecType::size_type i = 0; i < vecType::value_size(); ++i) @@ -91,10 +96,11 @@ namespace glm vecType const & y ) { - GLM_STATIC_ASSERT( + GLM_STATIC_ASSERT(( detail::type::is_float || detail::type::is_int || - detail::type::is_uint, "'greaterThanEqual' only accept numbers"); + detail::type::is_uint) && detail::is_vector >::_YES, + "'greaterThanEqual' only accept numbers"); typename vecType::bool_type Result(vecType::null); for(typename vecType::size_type i = 0; i < vecType::value_size(); ++i) @@ -111,11 +117,7 @@ namespace glm vecType const & y ) { - GLM_STATIC_ASSERT( - detail::type::is_float || - detail::type::is_int || - detail::type::is_uint || - detail::type::is_bool, "'equal' only accept GLM vectors"); + GLM_STATIC_ASSERT(detail::is_vector >::_YES, "'equal' only accept GLM vectors"); typename vecType::bool_type Result(vecType::null); for(typename vecType::size_type i = 0; i < vecType::value_size(); ++i) @@ -132,11 +134,7 @@ namespace glm vecType const & y ) { - GLM_STATIC_ASSERT( - detail::type::is_float || - detail::type::is_int || - detail::type::is_uint || - detail::type::is_bool, "'notEqual' only accept GLM vectors"); + GLM_STATIC_ASSERT(detail::is_vector >::_YES, "'notEqual' only accept GLM vectors"); typename vecType::bool_type Result(vecType::null); for(typename vecType::size_type i = 0; i < vecType::value_size(); ++i) @@ -149,8 +147,7 @@ namespace glm template