Skip to content

Commit 7a785d4

Browse files
authored
[libc++][modules] Use inline variable instead of true_type (#106797)
This allows breaking up a dependency from __fwd/array.h onto __type_traits, which is a circular dependency once __type_traits becomes a module of its own. This is also a small consistency improvement since we've been using inline variables for traits like this elsewhere in the library.
1 parent d9019d4 commit 7a785d4

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

libcxx/include/__fwd/array.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ template <size_t _Ip, class _Tp, size_t _Size>
3535
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const _Tp&& get(const array<_Tp, _Size>&&) _NOEXCEPT;
3636
#endif
3737

38-
template <class>
39-
struct __is_std_array : false_type {};
38+
template <class _Tp>
39+
inline const bool __is_std_array_v = false;
4040

4141
template <class _Tp, size_t _Size>
42-
struct __is_std_array<array<_Tp, _Size> > : true_type {};
42+
inline const bool __is_std_array_v<array<_Tp, _Size> > = true;
4343

4444
_LIBCPP_END_NAMESPACE_STD
4545

libcxx/include/span

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ concept __span_compatible_range =
210210
ranges::contiguous_range<_Range> && //
211211
ranges::sized_range<_Range> && //
212212
(ranges::borrowed_range<_Range> || is_const_v<_ElementType>) && //
213-
!__is_std_array<remove_cvref_t<_Range>>::value && //
213+
!__is_std_array_v<remove_cvref_t<_Range>> && //
214214
!is_array_v<remove_cvref_t<_Range>> && //
215215
is_convertible_v<remove_reference_t<ranges::range_reference_t<_Range>> (*)[], _ElementType (*)[]>;
216216

0 commit comments

Comments
 (0)