diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2022-01-11 15:55:59 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2022-01-11 15:55:59 +0300 |
commit | c3b3821cce2a4eab4126e526f85121a6b671c930 (patch) | |
tree | 9a03bfc9fd50c4b06f2d49dfbd0e65123e0188e7 | |
parent | fcf3ddfb4889bb2098398e20e0cb6c2cb7305285 (diff) |
Simplify template macros
-rw-r--r-- | source/blender/blenlib/BLI_math_vector.hh | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/source/blender/blenlib/BLI_math_vector.hh b/source/blender/blenlib/BLI_math_vector.hh index 049027bf94c..9b485bf5187 100644 --- a/source/blender/blenlib/BLI_math_vector.hh +++ b/source/blender/blenlib/BLI_math_vector.hh @@ -51,14 +51,13 @@ namespace blender::math { #ifdef WITH_GMP # define BLI_ENABLE_IF_FLT_VEC(T) \ - BLI_ENABLE_IF((std::disjunction_v<std::is_floating_point<typename T::base_type>, \ - std::is_same<typename T::base_type, mpq_class>>)) + BLI_ENABLE_IF((std::is_floating_point_v<typename T::base_type> || \ + std::is_same_v<typename T::base_type, mpq_class>)) #else -# define BLI_ENABLE_IF_FLT_VEC(T) \ - BLI_ENABLE_IF((std::is_floating_point<typename T::base_type>::value)) +# define BLI_ENABLE_IF_FLT_VEC(T) BLI_ENABLE_IF((std::is_floating_point_v<typename T::base_type>)) #endif -#define BLI_ENABLE_IF_INT_VEC(T) BLI_ENABLE_IF((std::is_integral<typename T::base_type>::value)) +#define BLI_ENABLE_IF_INT_VEC(T) BLI_ENABLE_IF((std::is_integral_v<typename T::base_type>)) template<typename T> inline bool is_zero(const T &a) { |