Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // -*- C++ -*-
0002 //===----------------------------------------------------------------------===//
0003 //
0004 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0005 // See https://llvm.org/LICENSE.txt for license information.
0006 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0007 //
0008 //===----------------------------------------------------------------------===//
0009 
0010 #ifndef _LIBCPP___ITERATOR_REVERSE_ACCESS_H
0011 #define _LIBCPP___ITERATOR_REVERSE_ACCESS_H
0012 
0013 #include <__config>
0014 #include <__iterator/reverse_iterator.h>
0015 #include <initializer_list>
0016 
0017 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
0018 #  pragma GCC system_header
0019 #endif
0020 
0021 _LIBCPP_BEGIN_NAMESPACE_STD
0022 
0023 #if _LIBCPP_STD_VER >= 14
0024 
0025 template <class _Tp, size_t _Np>
0026 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reverse_iterator<_Tp*> rbegin(_Tp (&__array)[_Np]) {
0027   return reverse_iterator<_Tp*>(__array + _Np);
0028 }
0029 
0030 template <class _Tp, size_t _Np>
0031 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reverse_iterator<_Tp*> rend(_Tp (&__array)[_Np]) {
0032   return reverse_iterator<_Tp*>(__array);
0033 }
0034 
0035 template <class _Ep>
0036 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reverse_iterator<const _Ep*> rbegin(initializer_list<_Ep> __il) {
0037   return reverse_iterator<const _Ep*>(__il.end());
0038 }
0039 
0040 template <class _Ep>
0041 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reverse_iterator<const _Ep*> rend(initializer_list<_Ep> __il) {
0042   return reverse_iterator<const _Ep*>(__il.begin());
0043 }
0044 
0045 template <class _Cp>
0046 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 auto rbegin(_Cp& __c) -> decltype(__c.rbegin()) {
0047   return __c.rbegin();
0048 }
0049 
0050 template <class _Cp>
0051 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 auto rbegin(const _Cp& __c) -> decltype(__c.rbegin()) {
0052   return __c.rbegin();
0053 }
0054 
0055 template <class _Cp>
0056 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 auto rend(_Cp& __c) -> decltype(__c.rend()) {
0057   return __c.rend();
0058 }
0059 
0060 template <class _Cp>
0061 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 auto rend(const _Cp& __c) -> decltype(__c.rend()) {
0062   return __c.rend();
0063 }
0064 
0065 template <class _Cp>
0066 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 auto crbegin(const _Cp& __c) -> decltype(std::rbegin(__c)) {
0067   return std::rbegin(__c);
0068 }
0069 
0070 template <class _Cp>
0071 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 auto crend(const _Cp& __c) -> decltype(std::rend(__c)) {
0072   return std::rend(__c);
0073 }
0074 
0075 #endif // _LIBCPP_STD_VER >= 14
0076 
0077 _LIBCPP_END_NAMESPACE_STD
0078 
0079 #endif // _LIBCPP___ITERATOR_REVERSE_ACCESS_H