File indexing completed on 2026-05-03 08:13:33
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef _LIBCPP___CXX03___ITERATOR_REVERSE_ACCESS_H
0011 #define _LIBCPP___CXX03___ITERATOR_REVERSE_ACCESS_H
0012
0013 #include <__cxx03/__config>
0014 #include <__cxx03/__iterator/reverse_iterator.h>
0015 #include <__cxx03/cstddef>
0016 #include <__cxx03/initializer_list>
0017
0018 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
0019 # pragma GCC system_header
0020 #endif
0021
0022 _LIBCPP_BEGIN_NAMESPACE_STD
0023
0024 #if _LIBCPP_STD_VER >= 14
0025
0026 template <class _Tp, size_t _Np>
0027 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reverse_iterator<_Tp*> rbegin(_Tp (&__array)[_Np]) {
0028 return reverse_iterator<_Tp*>(__array + _Np);
0029 }
0030
0031 template <class _Tp, size_t _Np>
0032 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reverse_iterator<_Tp*> rend(_Tp (&__array)[_Np]) {
0033 return reverse_iterator<_Tp*>(__array);
0034 }
0035
0036 template <class _Ep>
0037 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reverse_iterator<const _Ep*> rbegin(initializer_list<_Ep> __il) {
0038 return reverse_iterator<const _Ep*>(__il.end());
0039 }
0040
0041 template <class _Ep>
0042 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 reverse_iterator<const _Ep*> rend(initializer_list<_Ep> __il) {
0043 return reverse_iterator<const _Ep*>(__il.begin());
0044 }
0045
0046 template <class _Cp>
0047 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 auto rbegin(_Cp& __c) -> decltype(__c.rbegin()) {
0048 return __c.rbegin();
0049 }
0050
0051 template <class _Cp>
0052 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 auto rbegin(const _Cp& __c) -> decltype(__c.rbegin()) {
0053 return __c.rbegin();
0054 }
0055
0056 template <class _Cp>
0057 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 auto rend(_Cp& __c) -> decltype(__c.rend()) {
0058 return __c.rend();
0059 }
0060
0061 template <class _Cp>
0062 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 auto rend(const _Cp& __c) -> decltype(__c.rend()) {
0063 return __c.rend();
0064 }
0065
0066 template <class _Cp>
0067 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 auto crbegin(const _Cp& __c) -> decltype(std::rbegin(__c)) {
0068 return std::rbegin(__c);
0069 }
0070
0071 template <class _Cp>
0072 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX17 auto crend(const _Cp& __c) -> decltype(std::rend(__c)) {
0073 return std::rend(__c);
0074 }
0075
0076 #endif
0077
0078 _LIBCPP_END_NAMESPACE_STD
0079
0080 #endif