Skip to content

Commit c8eae78

Browse files
committed
[libc++] Use builtin for std::is_bounded_array
1 parent 0c57f89 commit c8eae78

File tree

1 file changed

+5
-16
lines changed

1 file changed

+5
-16
lines changed

libcxx/include/__type_traits/is_bounded_array.h

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#define _LIBCPP___TYPE_TRAITS_IS_BOUNDED_ARRAY_H
1111

1212
#include <__config>
13-
#include <__cstddef/size_t.h>
1413
#include <__type_traits/integral_constant.h>
1514

1615
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -19,26 +18,16 @@
1918

2019
_LIBCPP_BEGIN_NAMESPACE_STD
2120

22-
template <class>
23-
inline const bool __is_bounded_array_v = false;
24-
template <class _Tp, size_t _Np>
25-
inline const bool __is_bounded_array_v<_Tp[_Np]> = true;
21+
template <class _Tp>
22+
inline const bool __is_bounded_array_v = __is_bounded_array(_Tp);
2623

2724
#if _LIBCPP_STD_VER >= 20
2825

29-
template <class>
30-
struct _LIBCPP_NO_SPECIALIZATIONS is_bounded_array : false_type {};
31-
32-
_LIBCPP_DIAGNOSTIC_PUSH
33-
# if __has_warning("-Winvalid-specialization")
34-
_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Winvalid-specialization")
35-
# endif
36-
template <class _Tp, size_t _Np>
37-
struct is_bounded_array<_Tp[_Np]> : true_type {};
38-
_LIBCPP_DIAGNOSTIC_POP
26+
template <class _Tp>
27+
struct _LIBCPP_NO_SPECIALIZATIONS is_bounded_array : bool_constant<__is_bounded_array(_Tp)> {};
3928

4029
template <class _Tp>
41-
_LIBCPP_NO_SPECIALIZATIONS inline constexpr bool is_bounded_array_v = is_bounded_array<_Tp>::value;
30+
_LIBCPP_NO_SPECIALIZATIONS inline constexpr bool is_bounded_array_v = __is_bounded_array(_Tp);
4231

4332
#endif
4433

0 commit comments

Comments
 (0)