tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
rbegin.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2
3#ifndef TETL_ITERATOR_RBEGIN_HPP
4#define TETL_ITERATOR_RBEGIN_HPP
5
7
8namespace etl {
9
10template <typename Iter>
11struct reverse_iterator;
12
15template <typename Container>
16constexpr auto rbegin(Container& c) -> decltype(c.rbegin())
17{
18 return c.rbegin();
19}
20
22template <typename Container>
23constexpr auto rbegin(Container const& c) -> decltype(c.rbegin())
24{
25 return c.rbegin();
26}
27
29template <typename T, size_t N>
30constexpr auto rbegin(T (&array)[N]) -> reverse_iterator<T*>
31{
33}
34
36template <typename Container>
37constexpr auto crbegin(Container const& c) -> decltype(rbegin(c))
38{
39 return rbegin(c);
40}
41
42} // namespace etl
43
44#endif // TETL_ITERATOR_RBEGIN_HPP
constexpr auto crbegin(Container const &c) -> decltype(rbegin(c))
Definition rbegin.hpp:37
constexpr auto end(C &c) -> decltype(c.end())
Returns an iterator to the end (i.e. the element after the last element) of the given container c or ...
Definition end.hpp:14
constexpr auto rbegin(Container &c) -> decltype(c.rbegin())
Returns an iterator to the reverse-beginning of the given container.
Definition rbegin.hpp:16
Definition adjacent_find.hpp:8
A container that encapsulates fixed size arrays.
Definition array.hpp:48
reverse_iterator is an iterator adaptor that reverses the direction of a given iterator....
Definition reverse_iterator.hpp:22