30#ifndef _GLIBCXX_RANGE_ACCESS_H
31#define _GLIBCXX_RANGE_ACCESS_H 1
34#pragma GCC system_header
37#if __cplusplus >= 201103L
42namespace std _GLIBCXX_VISIBILITY(default)
44_GLIBCXX_BEGIN_NAMESPACE_VERSION
52 template<
typename _Container>
53 [[__nodiscard__, __gnu__::__always_inline__]]
54 inline _GLIBCXX17_CONSTEXPR
auto
55 begin(_Container& __cont)
noexcept(
noexcept(__cont.begin()))
56 ->
decltype(__cont.begin())
57 {
return __cont.begin(); }
64 template<
typename _Container>
65 [[__nodiscard__, __gnu__::__always_inline__]]
66 inline _GLIBCXX17_CONSTEXPR
auto
67 begin(
const _Container& __cont)
noexcept(
noexcept(__cont.begin()))
68 ->
decltype(__cont.begin())
69 {
return __cont.begin(); }
77 template<
typename _Container>
78 [[__nodiscard__, __gnu__::__always_inline__]]
79 inline _GLIBCXX17_CONSTEXPR
auto
80 end(_Container& __cont)
noexcept(
noexcept(__cont.end()))
81 ->
decltype(__cont.end())
82 {
return __cont.end(); }
90 template<
typename _Container>
91 [[__nodiscard__, __gnu__::__always_inline__]]
92 inline _GLIBCXX17_CONSTEXPR
auto
93 end(
const _Container& __cont)
noexcept(
noexcept(__cont.end()))
94 ->
decltype(__cont.end())
95 {
return __cont.end(); }
102 template<
typename _Tp,
size_t _Nm>
103 [[__nodiscard__, __gnu__::__always_inline__]]
104 inline _GLIBCXX14_CONSTEXPR _Tp*
114 template<
typename _Tp,
size_t _Nm>
115 [[__nodiscard__, __gnu__::__always_inline__]]
116 inline _GLIBCXX14_CONSTEXPR _Tp*
117 end(_Tp (&__arr)[_Nm])
noexcept
118 {
return __arr + _Nm; }
120#if __cplusplus >= 201402L
122 template<
typename _Tp>
class valarray;
124 template<
typename _Tp> _Tp*
begin(valarray<_Tp>&)
noexcept;
125 template<
typename _Tp>
const _Tp*
begin(
const valarray<_Tp>&)
noexcept;
126 template<
typename _Tp> _Tp*
end(valarray<_Tp>&)
noexcept;
127 template<
typename _Tp>
const _Tp*
end(
const valarray<_Tp>&)
noexcept;
135 template<
typename _Container>
136 [[__nodiscard__, __gnu__::__always_inline__]]
148 template<
typename _Container>
149 [[__nodiscard__, __gnu__::__always_inline__]]
161 template<
typename _Container>
162 [[__nodiscard__, __gnu__::__always_inline__]]
163 inline _GLIBCXX17_CONSTEXPR
auto
164 rbegin(_Container& __cont)
noexcept(
noexcept(__cont.rbegin()))
165 ->
decltype(__cont.rbegin())
166 {
return __cont.rbegin(); }
174 template<
typename _Container>
175 [[__nodiscard__, __gnu__::__always_inline__]]
176 inline _GLIBCXX17_CONSTEXPR
auto
177 rbegin(
const _Container& __cont)
noexcept(
noexcept(__cont.rbegin()))
178 ->
decltype(__cont.rbegin())
179 {
return __cont.rbegin(); }
187 template<
typename _Container>
188 [[__nodiscard__, __gnu__::__always_inline__]]
189 inline _GLIBCXX17_CONSTEXPR
auto
190 rend(_Container& __cont)
noexcept(
noexcept(__cont.rend()))
191 ->
decltype(__cont.rend())
192 {
return __cont.rend(); }
200 template<
typename _Container>
201 [[__nodiscard__, __gnu__::__always_inline__]]
202 inline _GLIBCXX17_CONSTEXPR
auto
203 rend(
const _Container& __cont)
noexcept(
noexcept(__cont.rend()))
204 ->
decltype(__cont.rend())
205 {
return __cont.rend(); }
213 template<
typename _Tp,
size_t _Nm>
215 inline _GLIBCXX17_CONSTEXPR reverse_iterator<_Tp*>
225 template<
typename _Tp,
size_t _Nm>
227 inline _GLIBCXX17_CONSTEXPR reverse_iterator<_Tp*>
228 rend(_Tp (&__arr)[_Nm])
noexcept
237 template<
typename _Tp>
239 inline _GLIBCXX17_CONSTEXPR reverse_iterator<const _Tp*>
249 template<
typename _Tp>
251 inline _GLIBCXX17_CONSTEXPR reverse_iterator<const _Tp*>
261 template<
typename _Container>
262 [[__nodiscard__, __gnu__::__always_inline__]]
263 inline _GLIBCXX17_CONSTEXPR
auto
274 template<
typename _Container>
275 [[__nodiscard__, __gnu__::__always_inline__]]
276 inline _GLIBCXX17_CONSTEXPR
auto
283#ifdef __glibcxx_nonmember_container_access
289 template <
typename _Container>
290 [[nodiscard, __gnu__::__always_inline__]]
292 size(
const _Container& __cont)
noexcept(
noexcept(__cont.size()))
293 ->
decltype(__cont.size())
294 {
return __cont.size(); }
302 template <
typename _Tp,
size_t _Nm>
303 [[nodiscard, __gnu__::__always_inline__]]
305 size(
const _Tp (&)[_Nm])
noexcept
313 template <
typename _Container>
314 [[nodiscard, __gnu__::__always_inline__]]
316 empty(
const _Container& __cont)
noexcept(
noexcept(__cont.empty()))
317 ->
decltype(__cont.empty())
318 {
return __cont.empty(); }
325 template <
typename _Tp,
size_t _Nm>
326 [[nodiscard, __gnu__::__always_inline__]]
336 template <
typename _Tp>
337 [[nodiscard, __gnu__::__always_inline__]]
340 {
return __il.size() == 0;}
347 template <
typename _Container>
348 [[nodiscard, __gnu__::__always_inline__]]
350 data(_Container& __cont)
noexcept(
noexcept(__cont.data()))
351 ->
decltype(__cont.data())
352 {
return __cont.data(); }
359 template <
typename _Container>
360 [[nodiscard, __gnu__::__always_inline__]]
362 data(
const _Container& __cont)
noexcept(
noexcept(__cont.data()))
363 ->
decltype(__cont.data())
364 {
return __cont.data(); }
371 template <
typename _Tp,
size_t _Nm>
372 [[nodiscard, __gnu__::__always_inline__]]
374 data(_Tp (&__array)[_Nm])
noexcept
382 template <
typename _Tp>
383 [[nodiscard, __gnu__::__always_inline__]]
386 {
return __il.begin(); }
389#ifdef __glibcxx_ssize
395 template<
typename _Container>
396 [[nodiscard, __gnu__::__always_inline__]]
398 ssize(
const _Container& __cont)
noexcept(
noexcept(__cont.size()))
409 template<
typename _Tp, ptrdiff_t _Num>
410 [[nodiscard, __gnu__::__always_inline__]]
415_GLIBCXX_END_NAMESPACE_VERSION
typename make_signed< _Tp >::type make_signed_t
Alias template for make_signed.
typename common_type< _Tp... >::type common_type_t
Alias template for common_type.
_Tp * end(valarray< _Tp > &__va) noexcept
Return an iterator pointing to one past the last element of the valarray.
_Tp * begin(valarray< _Tp > &__va) noexcept
Return an iterator pointing to the first element of the valarray.
ISO C++ entities toplevel namespace is std.
constexpr auto rbegin(_Container &__cont) noexcept(noexcept(__cont.rbegin())) -> decltype(__cont.rbegin())
Return a reverse iterator pointing to the last element of the container.
constexpr auto cend(const _Container &__cont) noexcept(noexcept(std::end(__cont))) -> decltype(std::end(__cont))
Return an iterator pointing to one past the last element of the const container.
constexpr auto empty(const _Container &__cont) noexcept(noexcept(__cont.empty())) -> decltype(__cont.empty())
Return whether a container is empty.
constexpr auto crbegin(const _Container &__cont) noexcept(noexcept(std::rbegin(__cont))) -> decltype(std::rbegin(__cont))
Return a reverse iterator pointing to the last element of the const container.
constexpr auto size(const _Container &__cont) noexcept(noexcept(__cont.size())) -> decltype(__cont.size())
Return the size of a container.
constexpr auto data(_Container &__cont) noexcept(noexcept(__cont.data())) -> decltype(__cont.data())
Return the data pointer of a container.
constexpr auto cbegin(const _Container &__cont) noexcept(noexcept(std::begin(__cont))) -> decltype(std::begin(__cont))
Return an iterator pointing to the first element of the const container.
constexpr auto rend(_Container &__cont) noexcept(noexcept(__cont.rend())) -> decltype(__cont.rend())
Return a reverse iterator pointing one past the first element of the container.
constexpr auto ssize(const _Container &__cont) noexcept(noexcept(__cont.size())) -> common_type_t< ptrdiff_t, make_signed_t< decltype(__cont.size())> >
Return the size of a container, as a signed integer.
constexpr auto crend(const _Container &__cont) noexcept(noexcept(std::rend(__cont))) -> decltype(std::rend(__cont))
Return a reverse iterator pointing one past the first element of the const container.