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
51 template<
typename _Container>
52 [[__nodiscard__, __gnu__::__always_inline__]]
53 inline _GLIBCXX17_CONSTEXPR
auto
54 begin(_Container& __cont)
noexcept(
noexcept(__cont.begin()))
55 ->
decltype(__cont.begin())
56 {
return __cont.begin(); }
63 template<
typename _Container>
64 [[__nodiscard__, __gnu__::__always_inline__]]
65 inline _GLIBCXX17_CONSTEXPR
auto
66 begin(
const _Container& __cont)
noexcept(
noexcept(__cont.begin()))
67 ->
decltype(__cont.begin())
68 {
return __cont.begin(); }
75 template<
typename _Container>
76 [[__nodiscard__, __gnu__::__always_inline__]]
77 inline _GLIBCXX17_CONSTEXPR
auto
78 end(_Container& __cont)
noexcept(
noexcept(__cont.end()))
79 ->
decltype(__cont.end())
80 {
return __cont.end(); }
87 template<
typename _Container>
88 [[__nodiscard__, __gnu__::__always_inline__]]
89 inline _GLIBCXX17_CONSTEXPR
auto
90 end(
const _Container& __cont)
noexcept(
noexcept(__cont.end()))
91 ->
decltype(__cont.end())
92 {
return __cont.end(); }
98 template<
typename _Tp,
size_t _Nm>
99 [[__nodiscard__, __gnu__::__always_inline__]]
100 inline _GLIBCXX14_CONSTEXPR _Tp*
109 template<
typename _Tp,
size_t _Nm>
110 [[__nodiscard__, __gnu__::__always_inline__]]
111 inline _GLIBCXX14_CONSTEXPR _Tp*
112 end(_Tp (&__arr)[_Nm])
noexcept
113 {
return __arr + _Nm; }
115#if __cplusplus >= 201402L
117 template<
typename _Tp>
class valarray;
119 template<
typename _Tp> _Tp*
begin(valarray<_Tp>&)
noexcept;
120 template<
typename _Tp>
const _Tp*
begin(
const valarray<_Tp>&)
noexcept;
121 template<
typename _Tp> _Tp*
end(valarray<_Tp>&)
noexcept;
122 template<
typename _Tp>
const _Tp*
end(
const valarray<_Tp>&)
noexcept;
129 template<
typename _Container>
130 [[__nodiscard__, __gnu__::__always_inline__]]
141 template<
typename _Container>
142 [[__nodiscard__, __gnu__::__always_inline__]]
153 template<
typename _Container>
154 [[__nodiscard__, __gnu__::__always_inline__]]
155 inline _GLIBCXX17_CONSTEXPR
auto
156 rbegin(_Container& __cont)
noexcept(
noexcept(__cont.rbegin()))
157 ->
decltype(__cont.rbegin())
158 {
return __cont.rbegin(); }
165 template<
typename _Container>
166 [[__nodiscard__, __gnu__::__always_inline__]]
167 inline _GLIBCXX17_CONSTEXPR
auto
168 rbegin(
const _Container& __cont)
noexcept(
noexcept(__cont.rbegin()))
169 ->
decltype(__cont.rbegin())
170 {
return __cont.rbegin(); }
177 template<
typename _Container>
178 [[__nodiscard__, __gnu__::__always_inline__]]
179 inline _GLIBCXX17_CONSTEXPR
auto
180 rend(_Container& __cont)
noexcept(
noexcept(__cont.rend()))
181 ->
decltype(__cont.rend())
182 {
return __cont.rend(); }
189 template<
typename _Container>
190 [[__nodiscard__, __gnu__::__always_inline__]]
191 inline _GLIBCXX17_CONSTEXPR
auto
192 rend(
const _Container& __cont)
noexcept(
noexcept(__cont.rend()))
193 ->
decltype(__cont.rend())
194 {
return __cont.rend(); }
201 template<
typename _Tp,
size_t _Nm>
203 inline _GLIBCXX17_CONSTEXPR reverse_iterator<_Tp*>
212 template<
typename _Tp,
size_t _Nm>
214 inline _GLIBCXX17_CONSTEXPR reverse_iterator<_Tp*>
215 rend(_Tp (&__arr)[_Nm])
noexcept
223 template<
typename _Tp>
225 inline _GLIBCXX17_CONSTEXPR reverse_iterator<const _Tp*>
234 template<
typename _Tp>
236 inline _GLIBCXX17_CONSTEXPR reverse_iterator<const _Tp*>
245 template<
typename _Container>
246 [[__nodiscard__, __gnu__::__always_inline__]]
247 inline _GLIBCXX17_CONSTEXPR
auto
257 template<
typename _Container>
258 [[__nodiscard__, __gnu__::__always_inline__]]
259 inline _GLIBCXX17_CONSTEXPR
auto
266#ifdef __glibcxx_nonmember_container_access
271 template <
typename _Container>
272 [[nodiscard, __gnu__::__always_inline__]]
274 size(
const _Container& __cont)
noexcept(
noexcept(__cont.size()))
275 ->
decltype(__cont.size())
276 {
return __cont.size(); }
281 template <
typename _Tp,
size_t _Nm>
282 [[nodiscard, __gnu__::__always_inline__]]
284 size(
const _Tp (&)[_Nm])
noexcept
291 template <
typename _Container>
292 [[nodiscard, __gnu__::__always_inline__]]
294 empty(
const _Container& __cont)
noexcept(
noexcept(__cont.empty()))
295 ->
decltype(__cont.empty())
296 {
return __cont.empty(); }
301 template <
typename _Tp,
size_t _Nm>
302 [[nodiscard, __gnu__::__always_inline__]]
311 template <
typename _Tp>
312 [[nodiscard, __gnu__::__always_inline__]]
315 {
return __il.size() == 0;}
321 template <
typename _Container>
322 [[nodiscard, __gnu__::__always_inline__]]
324 data(_Container& __cont)
noexcept(
noexcept(__cont.data()))
325 ->
decltype(__cont.data())
326 {
return __cont.data(); }
332 template <
typename _Container>
333 [[nodiscard, __gnu__::__always_inline__]]
335 data(
const _Container& __cont)
noexcept(
noexcept(__cont.data()))
336 ->
decltype(__cont.data())
337 {
return __cont.data(); }
343 template <
typename _Tp,
size_t _Nm>
344 [[nodiscard, __gnu__::__always_inline__]]
346 data(_Tp (&__array)[_Nm])
noexcept
353 template <
typename _Tp>
354 [[nodiscard, __gnu__::__always_inline__]]
357 {
return __il.begin(); }
360#ifdef __glibcxx_ssize
361 template<
typename _Container>
362 [[nodiscard, __gnu__::__always_inline__]]
364 ssize(
const _Container& __cont)
noexcept(
noexcept(__cont.size()))
371 template<
typename _Tp, ptrdiff_t _Num>
372 [[nodiscard, __gnu__::__always_inline__]]
374 ssize(
const _Tp (&)[_Num])
noexcept
377_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 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.