[libcxx-commits] [libcxx] [libc++] Simplify the implementation of is_unbounded_array a bit (PR #137716)
via libcxx-commits
libcxx-commits at lists.llvm.org
Thu May 1 06:02:16 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-libcxx
Author: Nikolas Klauser (philnik777)
<details>
<summary>Changes</summary>
---
Full diff: https://github.com/llvm/llvm-project/pull/137716.diff
1 Files Affected:
- (modified) libcxx/include/__type_traits/is_unbounded_array.h (+2-10)
``````````diff
diff --git a/libcxx/include/__type_traits/is_unbounded_array.h b/libcxx/include/__type_traits/is_unbounded_array.h
index f2ccc15065236..e14809e26a787 100644
--- a/libcxx/include/__type_traits/is_unbounded_array.h
+++ b/libcxx/include/__type_traits/is_unbounded_array.h
@@ -25,19 +25,11 @@ inline const bool __is_unbounded_array_v<_Tp[]> = true;
#if _LIBCPP_STD_VER >= 20
-template <class>
-struct _LIBCPP_NO_SPECIALIZATIONS is_unbounded_array : false_type {};
-
-_LIBCPP_DIAGNOSTIC_PUSH
-# if __has_warning("-Winvalid-specialization")
-_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Winvalid-specialization")
-# endif
template <class _Tp>
-struct is_unbounded_array<_Tp[]> : true_type {};
-_LIBCPP_DIAGNOSTIC_POP
+struct _LIBCPP_NO_SPECIALIZATIONS is_unbounded_array : bool_constant<__is_unbounded_array_v<_Tp>> {};
template <class _Tp>
-_LIBCPP_NO_SPECIALIZATIONS inline constexpr bool is_unbounded_array_v = is_unbounded_array<_Tp>::value;
+_LIBCPP_NO_SPECIALIZATIONS inline constexpr bool is_unbounded_array_v = __is_unbounded_array_v<_Tp>;
#endif
``````````
</details>
https://github.com/llvm/llvm-project/pull/137716
More information about the libcxx-commits
mailing list