Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-03 08:13:10

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___ALGORITHM_RANGES_ITERATOR_CONCEPT_H
0010 #define _LIBCPP___ALGORITHM_RANGES_ITERATOR_CONCEPT_H
0011 
0012 #include <__config>
0013 #include <__iterator/concepts.h>
0014 #include <__iterator/iterator_traits.h>
0015 #include <__type_traits/remove_cvref.h>
0016 
0017 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
0018 #  pragma GCC system_header
0019 #endif
0020 
0021 _LIBCPP_PUSH_MACROS
0022 #include <__undef_macros>
0023 
0024 #if _LIBCPP_STD_VER >= 20
0025 
0026 _LIBCPP_BEGIN_NAMESPACE_STD
0027 
0028 namespace ranges {
0029 
0030 template <class _IterMaybeQualified>
0031 consteval auto __get_iterator_concept() {
0032   using _Iter = __remove_cvref_t<_IterMaybeQualified>;
0033 
0034   if constexpr (contiguous_iterator<_Iter>)
0035     return contiguous_iterator_tag();
0036   else if constexpr (random_access_iterator<_Iter>)
0037     return random_access_iterator_tag();
0038   else if constexpr (bidirectional_iterator<_Iter>)
0039     return bidirectional_iterator_tag();
0040   else if constexpr (forward_iterator<_Iter>)
0041     return forward_iterator_tag();
0042   else if constexpr (input_iterator<_Iter>)
0043     return input_iterator_tag();
0044 }
0045 
0046 template <class _Iter>
0047 using __iterator_concept _LIBCPP_NODEBUG = decltype(__get_iterator_concept<_Iter>());
0048 
0049 } // namespace ranges
0050 _LIBCPP_END_NAMESPACE_STD
0051 
0052 #endif // _LIBCPP_STD_VER >= 20
0053 
0054 _LIBCPP_POP_MACROS
0055 
0056 #endif // _LIBCPP___ALGORITHM_RANGES_ITERATOR_CONCEPT_H