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/subrange.h>
14 #include <__tuple/tuple_like_no_subrange.h>
15 #include <__tuple/tuple_size.h>
16 #include <__type_traits/remove_cvref.h>
18 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
19 # pragma GCC system_header
22 _LIBCPP_BEGIN_NAMESPACE_STD
24 #if _LIBCPP_STD_VER >= 20
27 inline constexpr bool __is_ranges_subrange_v
= false;
29 template <class _Iter
, class _Sent
, ranges::subrange_kind _Kind
>
30 inline constexpr bool __is_ranges_subrange_v
<ranges::subrange
<_Iter
, _Sent
, _Kind
>> = true;
33 concept __tuple_like
= __tuple_like_no_subrange
<_Tp
> || __is_ranges_subrange_v
<remove_cvref_t
<_Tp
>>;
35 // As of writing this comment every use of `pair-like` in the standard excludes `ranges::subrange`, so
36 // you most likely want to use `__pair_like_no_subrange` if you're looking for `pair-like`.
38 #endif // _LIBCPP_STD_VER >= 20
40 _LIBCPP_END_NAMESPACE_STD
42 #endif // _LIBCPP___TUPLE_TUPLE_LIKE_H