[libcxx-commits] [libcxx] [libc++][math] Provide overloads for cv-unqualified floating point types for `std::signbit` (PR #106566)

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Fri Sep 6 23:34:11 PDT 2024


================
@@ -34,8 +34,30 @@ namespace __math {
 #  define _LIBCPP_SIGNBIT_CONSTEXPR
 #endif
 
-template <class _A1, __enable_if_t<is_floating_point<_A1>::value, int> = 0>
-_LIBCPP_NODISCARD inline _LIBCPP_SIGNBIT_CONSTEXPR _LIBCPP_HIDE_FROM_ABI bool signbit(_A1 __x) _NOEXCEPT {
+_LIBCPP_NODISCARD inline _LIBCPP_SIGNBIT_CONSTEXPR _LIBCPP_HIDE_FROM_ABI
+#ifdef _LIBCPP_PREFERRED_OVERLOAD
+_LIBCPP_PREFERRED_OVERLOAD
+#endif
----------------
philnik777 wrote:

Why can't we instead make this a template like we do for other functions which may have already been provided by the libc?

https://github.com/llvm/llvm-project/pull/106566


More information about the libcxx-commits mailing list