30 #ifndef _GLIBCXX_RANGE_ACCESS_H
31 #define _GLIBCXX_RANGE_ACCESS_H 1
33 #pragma GCC system_header
35 #if __cplusplus >= 201103L
40 namespace std _GLIBCXX_VISIBILITY(default)
42 _GLIBCXX_BEGIN_NAMESPACE_VERSION
49 template<
typename _Container>
51 inline _GLIBCXX17_CONSTEXPR
auto
60 template<
typename _Container>
62 inline _GLIBCXX17_CONSTEXPR
auto
71 template<
typename _Container>
73 inline _GLIBCXX17_CONSTEXPR
auto
82 template<
typename _Container>
84 inline _GLIBCXX17_CONSTEXPR
auto
92 template<
typename _Tp,
size_t _Nm>
94 inline _GLIBCXX14_CONSTEXPR _Tp*
95 begin(_Tp (&__arr)[_Nm]) noexcept
103 template<
typename _Tp,
size_t _Nm>
105 inline _GLIBCXX14_CONSTEXPR _Tp*
106 end(_Tp (&__arr)[_Nm]) noexcept
107 {
return __arr + _Nm; }
109 #if __cplusplus >= 201402L
111 template<
typename _Tp>
class valarray;
113 template<
typename _Tp> _Tp*
begin(valarray<_Tp>&) noexcept;
114 template<
typename _Tp>
const _Tp*
begin(
const valarray<_Tp>&) noexcept;
115 template<
typename _Tp> _Tp*
end(valarray<_Tp>&) noexcept;
116 template<
typename _Tp>
const _Tp*
end(
const valarray<_Tp>&) noexcept;
123 template<
typename _Container>
135 template<
typename _Container>
147 template<
typename _Container>
149 inline _GLIBCXX17_CONSTEXPR
auto
151 {
return __cont.rbegin(); }
158 template<
typename _Container>
160 inline _GLIBCXX17_CONSTEXPR
auto
162 {
return __cont.rbegin(); }
169 template<
typename _Container>
171 inline _GLIBCXX17_CONSTEXPR
auto
180 template<
typename _Container>
182 inline _GLIBCXX17_CONSTEXPR
auto
191 template<
typename _Tp,
size_t _Nm>
193 inline _GLIBCXX17_CONSTEXPR reverse_iterator<_Tp*>
202 template<
typename _Tp,
size_t _Nm>
204 inline _GLIBCXX17_CONSTEXPR reverse_iterator<_Tp*>
205 rend(_Tp (&__arr)[_Nm]) noexcept
213 template<
typename _Tp>
215 inline _GLIBCXX17_CONSTEXPR reverse_iterator<const _Tp*>
224 template<
typename _Tp>
226 inline _GLIBCXX17_CONSTEXPR reverse_iterator<const _Tp*>
235 template<
typename _Container>
237 inline _GLIBCXX17_CONSTEXPR
auto
246 template<
typename _Container>
248 inline _GLIBCXX17_CONSTEXPR
auto
254 #if __cplusplus >= 201703L
255 #define __cpp_lib_nonmember_container_access 201411L
261 template <
typename _Container>
265 -> decltype(
__cont.size())
271 template <
typename _Tp,
size_t _Nm>
274 size(
const _Tp (&)[_Nm]) noexcept
281 template <
typename _Container>
282 [[nodiscard]] constexpr
auto
284 -> decltype(
__cont.empty())
285 {
return __cont.empty(); }
290 template <
typename _Tp,
size_t _Nm>
291 [[nodiscard]] constexpr
bool
299 template <
typename _Tp>
300 [[nodiscard]] constexpr
bool
302 {
return __il.size() == 0;}
308 template <
typename _Container>
312 -> decltype(
__cont.data())
319 template <
typename _Container>
323 -> decltype(
__cont.data())
330 template <
typename _Tp,
size_t _Nm>
333 data(_Tp (&__array)[_Nm]) noexcept
340 template <
typename _Tp>
344 {
return __il.begin(); }
346 #if __cplusplus > 201703L
347 #define __cpp_lib_ssize 201902L
348 template<
typename _Container>
351 ssize(
const _Container&
__cont)
352 noexcept(noexcept(
__cont.size()))
356 return static_cast<common_type_t<ptrdiff_t, type>
>(
__cont.size());
359 template<
typename _Tp, ptrdiff_t _Num>
362 ssize(
const _Tp (&)[_Num]) noexcept
367 _GLIBCXX_END_NAMESPACE_VERSION
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.
_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 crend(const _Container &__cont) -> decltype(std::rend(__cont))
Return a reverse iterator pointing one past the first element of the const container.
constexpr auto rend(_Container &__cont) -> decltype(__cont.rend())
Return a reverse iterator pointing one past the first 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 size(const _Container &__cont) noexcept(noexcept(__cont.size())) -> decltype(__cont.size())
Return the size of a container.
constexpr auto rbegin(_Container &__cont) -> decltype(__cont.rbegin())
Return a reverse iterator pointing to the last element of the container.
constexpr auto crbegin(const _Container &__cont) -> decltype(std::rbegin(__cont))
Return a reverse iterator pointing to the last 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 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.