brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.0 KiB · 30018d6 Raw
62 lines · c
1//===----------------------------------------------------------------------===//2//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-exception6//7//===----------------------------------------------------------------------===//8 9#ifndef _LIBCPP___TUPLE_TUPLE_LIKE_NO_SUBRANGE_H10#define _LIBCPP___TUPLE_TUPLE_LIKE_NO_SUBRANGE_H11 12#include <__config>13#include <__cstddef/size_t.h>14#include <__fwd/array.h>15#include <__fwd/complex.h>16#include <__fwd/pair.h>17#include <__fwd/tuple.h>18#include <__tuple/tuple_size.h>19#include <__type_traits/remove_cvref.h>20 21#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)22#  pragma GCC system_header23#endif24 25_LIBCPP_BEGIN_NAMESPACE_STD26 27#if _LIBCPP_STD_VER >= 2028 29template <class _Tp>30inline constexpr bool __tuple_like_no_subrange_impl = false;31 32template <class... _Tp>33inline constexpr bool __tuple_like_no_subrange_impl<tuple<_Tp...>> = true;34 35template <class _T1, class _T2>36inline constexpr bool __tuple_like_no_subrange_impl<pair<_T1, _T2>> = true;37 38template <class _Tp, size_t _Size>39inline constexpr bool __tuple_like_no_subrange_impl<array<_Tp, _Size>> = true;40 41#  if _LIBCPP_STD_VER >= 2642 43template <class _Tp>44inline constexpr bool __tuple_like_no_subrange_impl<complex<_Tp>> = true;45 46#  endif47 48template <class _Tp>49concept __tuple_like_no_subrange = __tuple_like_no_subrange_impl<remove_cvref_t<_Tp>>;50 51// This is equivalent to the exposition-only type trait `pair-like`, except that it is false for specializations of52// `ranges::subrange`. This is more useful than the pair-like concept in the standard because every use of `pair-like`53// excludes `ranges::subrange`.54template <class _Tp>55concept __pair_like_no_subrange = __tuple_like_no_subrange<_Tp> && tuple_size<remove_cvref_t<_Tp>>::value == 2;56 57#endif // _LIBCPP_STD_VER >= 2058 59_LIBCPP_END_NAMESPACE_STD60 61#endif // _LIBCPP___TUPLE_TUPLE_LIKE_NO_SUBRANGE_H62