Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-03 08:14:05

0001 //===----------------------------------------------------------------------===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef _LIBCPP___TUPLE_TUPLE_LIKE_NO_SUBRANGE_H
0010 #define _LIBCPP___TUPLE_TUPLE_LIKE_NO_SUBRANGE_H
0011 
0012 #include <__config>
0013 #include <__cstddef/size_t.h>
0014 #include <__fwd/array.h>
0015 #include <__fwd/complex.h>
0016 #include <__fwd/pair.h>
0017 #include <__fwd/tuple.h>
0018 #include <__tuple/tuple_size.h>
0019 #include <__type_traits/remove_cvref.h>
0020 
0021 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
0022 #  pragma GCC system_header
0023 #endif
0024 
0025 _LIBCPP_BEGIN_NAMESPACE_STD
0026 
0027 #if _LIBCPP_STD_VER >= 20
0028 
0029 template <class _Tp>
0030 inline constexpr bool __tuple_like_no_subrange_impl = false;
0031 
0032 template <class... _Tp>
0033 inline constexpr bool __tuple_like_no_subrange_impl<tuple<_Tp...>> = true;
0034 
0035 template <class _T1, class _T2>
0036 inline constexpr bool __tuple_like_no_subrange_impl<pair<_T1, _T2>> = true;
0037 
0038 template <class _Tp, size_t _Size>
0039 inline constexpr bool __tuple_like_no_subrange_impl<array<_Tp, _Size>> = true;
0040 
0041 #  if _LIBCPP_STD_VER >= 26
0042 
0043 template <class _Tp>
0044 inline constexpr bool __tuple_like_no_subrange_impl<complex<_Tp>> = true;
0045 
0046 #  endif
0047 
0048 template <class _Tp>
0049 concept __tuple_like_no_subrange = __tuple_like_no_subrange_impl<remove_cvref_t<_Tp>>;
0050 
0051 // This is equivalent to the exposition-only type trait `pair-like`, except that it is false for specializations of
0052 // `ranges::subrange`. This is more useful than the pair-like concept in the standard because every use of `pair-like`
0053 // excludes `ranges::subrange`.
0054 template <class _Tp>
0055 concept __pair_like_no_subrange = __tuple_like_no_subrange<_Tp> && tuple_size<remove_cvref_t<_Tp>>::value == 2;
0056 
0057 #endif // _LIBCPP_STD_VER >= 20
0058 
0059 _LIBCPP_END_NAMESPACE_STD
0060 
0061 #endif // _LIBCPP___TUPLE_TUPLE_LIKE_NO_SUBRANGE_H