1 //===----------------------------------------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #ifndef _LIBCPP___TUPLE_TUPLE_LIKE_H
10 #define _LIBCPP___TUPLE_TUPLE_LIKE_H
13 #include <__fwd/array.h>
14 #include <__fwd/pair.h>
15 #include <__fwd/subrange.h>
16 #include <__fwd/tuple.h>
17 #include <__type_traits/integral_constant.h>
18 #include <__type_traits/remove_cvref.h>
21 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
22 # pragma GCC system_header
25 _LIBCPP_BEGIN_NAMESPACE_STD
27 #if _LIBCPP_STD_VER >= 20
30 struct __tuple_like_impl
: false_type
{};
32 template <class... _Tp
>
33 struct __tuple_like_impl
<tuple
<_Tp
...> > : true_type
{};
35 template <class _T1
, class _T2
>
36 struct __tuple_like_impl
<pair
<_T1
, _T2
> > : true_type
{};
38 template <class _Tp
, size_t _Size
>
39 struct __tuple_like_impl
<array
<_Tp
, _Size
> > : true_type
{};
41 template <class _Ip
, class _Sp
, ranges::subrange_kind _Kp
>
42 struct __tuple_like_impl
<ranges::subrange
<_Ip
, _Sp
, _Kp
> > : true_type
{};
45 concept __tuple_like
= __tuple_like_impl
<remove_cvref_t
<_Tp
>>::value
;
47 #endif // _LIBCPP_STD_VER >= 20
49 _LIBCPP_END_NAMESPACE_STD
51 #endif // _LIBCPP___TUPLE_TUPLE_LIKE_H