2024-05-27 09:12:27 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef _LIBCPP___TUPLE_TUPLE_LIKE_H
|
|
|
|
#define _LIBCPP___TUPLE_TUPLE_LIKE_H
|
|
|
|
|
|
|
|
#include <__config>
|
|
|
|
#include <__fwd/subrange.h>
|
2024-07-23 10:16:17 +00:00
|
|
|
#include <__tuple/tuple_like_no_subrange.h>
|
|
|
|
#include <__tuple/tuple_size.h>
|
2024-05-27 09:12:27 +00:00
|
|
|
#include <__type_traits/remove_cvref.h>
|
|
|
|
|
|
|
|
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
|
|
|
|
# pragma GCC system_header
|
|
|
|
#endif
|
|
|
|
|
|
|
|
_LIBCPP_BEGIN_NAMESPACE_STD
|
|
|
|
|
|
|
|
#if _LIBCPP_STD_VER >= 20
|
|
|
|
|
|
|
|
template <class _Tp>
|
2024-07-23 10:16:17 +00:00
|
|
|
inline constexpr bool __is_ranges_subrange_v = false;
|
2024-05-27 09:12:27 +00:00
|
|
|
|
2024-07-23 10:16:17 +00:00
|
|
|
template <class _Iter, class _Sent, ranges::subrange_kind _Kind>
|
|
|
|
inline constexpr bool __is_ranges_subrange_v<ranges::subrange<_Iter, _Sent, _Kind>> = true;
|
2024-05-27 09:12:27 +00:00
|
|
|
|
|
|
|
template <class _Tp>
|
2024-07-23 10:16:17 +00:00
|
|
|
concept __tuple_like = __tuple_like_no_subrange<_Tp> || __is_ranges_subrange_v<remove_cvref_t<_Tp>>;
|
|
|
|
|
|
|
|
// As of writing this comment every use of `pair-like` in the standard excludes `ranges::subrange`, so
|
|
|
|
// you most likely want to use `__pair_like_no_subrange` if you're looking for `pair-like`.
|
2024-05-27 09:12:27 +00:00
|
|
|
|
|
|
|
#endif // _LIBCPP_STD_VER >= 20
|
|
|
|
|
|
|
|
_LIBCPP_END_NAMESPACE_STD
|
|
|
|
|
|
|
|
#endif // _LIBCPP___TUPLE_TUPLE_LIKE_H
|