We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 73de06e + d74f5dd commit f6ec67dCopy full SHA for f6ec67d
openvdb/openvdb/math/Math.h
@@ -319,10 +319,11 @@ inline long double Abs(long double x) { return std::fabs(x); }
319
inline uint32_t Abs(uint32_t i) { return i; }
320
inline uint64_t Abs(uint64_t i) { return i; }
321
inline bool Abs(bool b) { return b; }
322
-// On OSX size_t and uint64_t are different types
323
-#if defined(__APPLE__) || defined(MACOSX)
324
-inline size_t Abs(size_t i) { return i; }
325
-#endif
+// On systems like macOS and FreeBSD, size_t and uint64_t are different types
+template <typename T, typename std::enable_if<
+ std::is_same<T, size_t>::value
+ >::type* = nullptr>
326
+inline T Abs(T i) { return i; }
327
//@}
328
329
0 commit comments