tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
end.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2
3#ifndef TETL_ITERATOR_END_HPP
4#define TETL_ITERATOR_END_HPP
5
7
8namespace etl {
9
13template <typename C>
14constexpr auto end(C& c) -> decltype(c.end())
15{
16 return c.end();
17}
18
20template <typename C>
21constexpr auto end(C const& c) -> decltype(c.end())
22{
23 return c.end();
24}
25
27template <typename T, etl::size_t N>
28constexpr auto end(T (&array)[N]) noexcept -> T*
29{
30 return &array[N];
31}
32
34template <typename C>
35constexpr auto cend(C const& c) noexcept(noexcept(end(c))) -> decltype(end(c))
36{
37 return end(c);
38}
39
40} // namespace etl
41
42#endif // TETL_ITERATOR_END_HPP
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 cend(C const &c) noexcept(noexcept(end(c))) -> decltype(end(c))
Definition end.hpp:35
Definition adjacent_find.hpp:8
A container that encapsulates fixed size arrays.
Definition array.hpp:48