Skip to content

Commit 83967fd

Browse files
KeremTANpixelflinger
authored andcommitted
std type trait specialization of is_arithmetic and is_floating_type removed
1 parent b88c2d8 commit 83967fd

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

libs/math/include/math/half.h

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -173,17 +173,11 @@ template<> struct is_floating_point<half> : public std::true_type {};
173173

174174
namespace std {
175175

176-
// Note: This code may work with non-Clang compilers or Clang versions older than Clang 20.
177-
// Clang 20 explicitly blocks to customizing standard type traits.
178-
#if !defined(__clang__) || (defined(__clang__) && __clang_major__ < 20)
179-
template<> struct is_floating_point<filament::math::half> : public std::true_type {};
180-
181-
// note: this shouldn't be needed (is_floating_point<> is enough) but some version of msvc need it
182-
// This stopped working with MSVC 2019 16.4, so we specialize our own version of is_arithmetic in
176+
// Remove the standard template specializations for filament::math::half
177+
// Clang 20 explicitly blocks customizing standard type traits
178+
// Instead, use the traits defined in the math:: namespace
179+
// This avoids compatibility issues with Clang 20 and MSVC 2019 16.4+
183180
// the math::filament namespace (see above).
184-
template<> struct is_arithmetic<filament::math::half> : public std::true_type {};
185-
#endif
186-
187181
template<>
188182
class numeric_limits<filament::math::half> {
189183
public:

0 commit comments

Comments
 (0)