30 #ifndef _GLIBCXX_RANGE_ACCESS_H 31 #define _GLIBCXX_RANGE_ACCESS_H 1 33 #ifdef _GLIBCXX_SYSHDR 34 #pragma GCC system_header 37 #if __cplusplus >= 201103L 42 namespace std _GLIBCXX_VISIBILITY(default)
44 _GLIBCXX_BEGIN_NAMESPACE_VERSION
51 template<
typename _Container>
52 [[__nodiscard__, __gnu__::__always_inline__]]
53 inline _GLIBCXX17_CONSTEXPR
auto 55 -> decltype(
__cont.begin())
63 template<
typename _Container>
64 [[__nodiscard__, __gnu__::__always_inline__]]
65 inline _GLIBCXX17_CONSTEXPR
auto 67 -> decltype(
__cont.begin())
75 template<
typename _Container>
76 [[__nodiscard__, __gnu__::__always_inline__]]
77 inline _GLIBCXX17_CONSTEXPR
auto 87 template<
typename _Container>
88 [[__nodiscard__, __gnu__::__always_inline__]]
89 inline _GLIBCXX17_CONSTEXPR
auto 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 157 -> decltype(
__cont.rbegin())
158 {
return __cont.rbegin(); }
165 template<
typename _Container>
166 [[__nodiscard__, __gnu__::__always_inline__]]
167 inline _GLIBCXX17_CONSTEXPR
auto 169 -> decltype(
__cont.rbegin())
170 {
return __cont.rbegin(); }
177 template<
typename _Container>
178 [[__nodiscard__, __gnu__::__always_inline__]]
179 inline _GLIBCXX17_CONSTEXPR
auto 181 -> decltype(
__cont.rend())
189 template<
typename _Container>
190 [[__nodiscard__, __gnu__::__always_inline__]]
191 inline _GLIBCXX17_CONSTEXPR
auto 193 -> decltype(
__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 // C++ >= 17 271 template <
typename _Container>
272 [[nodiscard, __gnu__::__always_inline__]]
275 -> decltype(
__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__]]
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__]]
325 -> decltype(
__cont.data())
332 template <
typename _Container>
333 [[nodiscard, __gnu__::__always_inline__]]
336 -> decltype(
__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(); }
358 #endif // __glibcxx_nonmember_container_access 360 #ifdef __glibcxx_ssize // C++ >= 20 361 template<
typename _Container>
362 [[nodiscard, __gnu__::__always_inline__]]
364 ssize(
const _Container&
__cont) noexcept(noexcept(
__cont.size()))
368 return static_cast<common_type_t<ptrdiff_t, type>
>(
__cont.size());
371 template<
typename _Tp, ptrdiff_t _Num>
372 [[nodiscard, __gnu__::__always_inline__]]
374 ssize(
const _Tp (&)[_Num]) noexcept
376 #endif // __glibcxx_ssize 377 _GLIBCXX_END_NAMESPACE_VERSION
381 #endif // _GLIBCXX_RANGE_ACCESS_H _Tp * end(valarray< _Tp > &__va) noexcept
Return an iterator pointing to one past the last element of the valarray.
typename common_type< _Tp... >::type common_type_t
Alias template for common_type.
typename make_signed< _Tp >::type make_signed_t
Alias template for make_signed.
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 rbegin(_Container &__cont) noexcept(noexcept(__cont.rbegin())) -> decltype(__cont.rbegin())
Return a reverse iterator pointing to the last element of the container.
_Tp * begin(valarray< _Tp > &__va) noexcept
Return an iterator pointing to the first element of the valarray.
constexpr auto empty(const _Container &__cont) noexcept(noexcept(__cont.empty())) -> decltype(__cont.empty())
Return whether a container is empty.
ISO C++ entities toplevel namespace is std.
constexpr auto size(const _Container &__cont) noexcept(noexcept(__cont.size())) -> decltype(__cont.size())
Return the size of a container.
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 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 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.
constexpr auto data(_Container &__cont) noexcept(noexcept(__cont.data())) -> decltype(__cont.data())
Return the data pointer of a 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.