Skip to content

Commit 180bc59

Browse files
authored
[libc++] Simplify the implementation of is_unbounded_array a bit (llvm#137716)
1 parent 4994174 commit 180bc59

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

libcxx/include/__type_traits/is_unbounded_array.h

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,11 @@ inline const bool __is_unbounded_array_v<_Tp[]> = true;
2525

2626
#if _LIBCPP_STD_VER >= 20
2727

28-
template <class>
29-
struct _LIBCPP_NO_SPECIALIZATIONS is_unbounded_array : false_type {};
30-
31-
_LIBCPP_DIAGNOSTIC_PUSH
32-
# if __has_warning("-Winvalid-specialization")
33-
_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Winvalid-specialization")
34-
# endif
3528
template <class _Tp>
36-
struct is_unbounded_array<_Tp[]> : true_type {};
37-
_LIBCPP_DIAGNOSTIC_POP
29+
struct _LIBCPP_NO_SPECIALIZATIONS is_unbounded_array : bool_constant<__is_unbounded_array_v<_Tp>> {};
3830

3931
template <class _Tp>
40-
_LIBCPP_NO_SPECIALIZATIONS inline constexpr bool is_unbounded_array_v = is_unbounded_array<_Tp>::value;
32+
_LIBCPP_NO_SPECIALIZATIONS inline constexpr bool is_unbounded_array_v = __is_unbounded_array_v<_Tp>;
4133

4234
#endif
4335

0 commit comments

Comments
 (0)