Page Menu
Home
Search
Configure Global Search
Log In
Paste
P2988
MPQ Separate
Archived
Public
Actions
Authored by
Hans Goudey (HooglyBoogly)
on May 31 2022, 12:16 PM.
Edit Paste
Activate Paste
View Raw File
Subscribe
Mute Notifications
Award Token
Tags
None
Subscribers
None
diff --git a/source/blender/blenlib/BLI_math_base.hh b/source/blender/blenlib/BLI_math_base.hh
index 034c6968c94..7ae6f899bcf 100644
--- a/source/blender/blenlib/BLI_math_base.hh
+++ b/source/blender/blenlib/BLI_math_base.hh
@@ -14,18 +14,12 @@
#include "BLI_math_base_safe.h"
#include "BLI_utildefines.h"
-#ifdef WITH_GMP
-# include "BLI_math_mpq.hh"
-#endif
-
namespace blender::math {
-template<typename T>
-inline constexpr bool is_math_float_type = (std::is_floating_point_v<T>
-#ifdef WITH_GMP
- || std::is_same_v<T, mpq_class>
-#endif
-);
+// template<typename T> static constexpr bool is_math_float_type = std::is_floating_point_v<T>;
+template<typename T> constexpr bool is_math_float_type = false;
+template<> constexpr bool is_math_float_type<float> = true;
+template<> constexpr bool is_math_float_type<double> = true;
template<typename T> inline constexpr bool is_math_integral_type = std::is_integral_v<T>;
diff --git a/source/blender/blenlib/BLI_math_mpq.hh b/source/blender/blenlib/BLI_math_mpq.hh
index 7b43c90da84..fd2c17b903a 100644
--- a/source/blender/blenlib/BLI_math_mpq.hh
+++ b/source/blender/blenlib/BLI_math_mpq.hh
@@ -19,4 +19,8 @@
*/
# include "gmpxx.h"
+# include "BLI_math_base.hh"
+
+template<> constexpr bool is_math_float_type<mpq_class> = true;
+
#endif /* WITH_GMP */
diff --git a/source/blender/blenlib/BLI_math_vec_types.hh b/source/blender/blenlib/BLI_math_vec_types.hh
index e36bbedee32..7f20881dfa3 100644
--- a/source/blender/blenlib/BLI_math_vec_types.hh
+++ b/source/blender/blenlib/BLI_math_vec_types.hh
@@ -14,10 +14,6 @@
#include "BLI_utildefines.h"
-#ifdef WITH_GMP
-# include "BLI_math_mpq.hh"
-#endif
-
namespace blender {
/* clang-format off */
Event Timeline
Hans Goudey (HooglyBoogly)
created this paste.
May 31 2022, 12:16 PM
Hans Goudey (HooglyBoogly)
archived this paste.
May 31 2022, 12:46 PM
Log In to Comment