Files
2025-10-25 03:02:53 +03:00

9.4 KiB
Raw Permalink Blame History

[iterator.range]

24 Iterators library [iterators]

24.7 Range access [iterator.range]

1

#

In addition to being available via inclusion of the header, the function templates in [iterator.range] are available when any of the following headers are included:,,<flat_map>,<flat_set>,<forward_list>,,<inplace_vector>,,,,,,,<string_view>,<unordered_map>,<unordered_set>, and.

🔗

template<class C> constexpr auto begin(C& c) -> decltype(c.begin()); template<class C> constexpr auto begin(const C& c) -> decltype(c.begin());

2

#

Returns: c.begin().

🔗

template<class C> constexpr auto end(C& c) -> decltype(c.end()); template<class C> constexpr auto end(const C& c) -> decltype(c.end());

3

#

Returns: c.end().

🔗

template<class T, size_t N> constexpr T* begin(T (&array)[N]) noexcept;

4

#

Returns: array.

🔗

template<class T, size_t N> constexpr T* end(T (&array)[N]) noexcept;

5

#

Returns: array + N.

🔗

template<class C> constexpr auto cbegin(const C& c) noexcept(noexcept(std::begin(c))) -> decltype(std::begin(c));

6

#

Returns: std::begin(c).

🔗

template<class C> constexpr auto cend(const C& c) noexcept(noexcept(std::end(c))) -> decltype(std::end(c));

7

#

Returns: std::end(c).

🔗

template<class C> constexpr auto rbegin(C& c) -> decltype(c.rbegin()); template<class C> constexpr auto rbegin(const C& c) -> decltype(c.rbegin());

8

#

Returns: c.rbegin().

🔗

template<class C> constexpr auto rend(C& c) -> decltype(c.rend()); template<class C> constexpr auto rend(const C& c) -> decltype(c.rend());

9

#

Returns: c.rend().

🔗

template<class T, size_t N> constexpr reverse_iterator<T*> rbegin(T (&array)[N]);

10

#

Returns: reverse_iterator<T*>(array + N).

🔗

template<class T, size_t N> constexpr reverse_iterator<T*> rend(T (&array)[N]);

11

#

Returns: reverse_iterator<T*>(array).

🔗

template<class E> constexpr reverse_iterator<const E*> rbegin(initializer_list<E> il);

12

#

Returns: reverse_iterator<const E*>(il.end()).

🔗

template<class E> constexpr reverse_iterator<const E*> rend(initializer_list<E> il);

13

#

Returns: reverse_iterator<const E*>(il.begin()).

🔗

template<class C> constexpr auto crbegin(const C& c) -> decltype(std::rbegin(c));

14

#

Returns: std::rbegin(c).

🔗

template<class C> constexpr auto crend(const C& c) -> decltype(std::rend(c));

15

#

Returns: std::rend(c).

🔗

template<class C> constexpr auto size(const C& c) -> decltype(c.size());

16

#

Returns: c.size().

🔗

template<class T, size_t N> constexpr size_t size(const T (&array)[N]) noexcept;

17

#

Returns: N.

🔗

template<class C> constexpr auto ssize(const C& c) -> common_type_t<ptrdiff_t, make_signed_t<decltype(c.size())>>;

18

#

Effects: Equivalent to:return static_cast<common_type_t<ptrdiff_t, make_signed_t<decltype(c.size())>>>(c.size());

🔗

template<class T, ptrdiff_t N> constexpr ptrdiff_t ssize(const T (&array)[N]) noexcept;

19

#

Returns: N.

🔗

template<class C> constexpr auto empty(const C& c) -> decltype(c.empty());

20

#

Returns: c.empty().

🔗

template<class T, size_t N> constexpr bool empty(const T (&array)[N]) noexcept;

21

#

Returns: false.

🔗

template<class E> constexpr bool empty(initializer_list<E> il) noexcept;

22

#

Returns: il.size() == 0.

🔗

template<class C> constexpr auto data(C& c) -> decltype(c.data()); template<class C> constexpr auto data(const C& c) -> decltype(c.data());

23

#

Returns: c.data().

🔗

template<class T, size_t N> constexpr T* data(T (&array)[N]) noexcept;

24

#

Returns: array.

🔗

template<class E> constexpr const E* data(initializer_list<E> il) noexcept;

25

#

Returns: il.begin().