4#ifndef TETL_ALGORITHM_REVERSE_HPP
5#define TETL_ALGORITHM_REVERSE_HPP
7#include <etl/_algorithm/iter_swap.hpp>
8#include <etl/_iterator/iterator_traits.hpp>
9#include <etl/_iterator/tags.hpp>
10#include <etl/_type_traits/is_base_of.hpp>
16template <
typename BidirIt>
17constexpr auto reverse(BidirIt first, BidirIt last) ->
void
25 for (--last; first < last; (
void)++first, --last) {
26 etl::iter_swap(first, last);
29 while (first != last
and first != --last) {
30 etl::iter_swap(first++, last);
constexpr auto reverse(BidirIt first, BidirIt last) -> void
Reverses the order of the elements in the range [first, last).
Definition reverse.hpp:17
Definition adjacent_find.hpp:9
iterator_traits is the type trait class that provides uniform interface to the properties of LegacyIt...
Definition iterator_traits.hpp:48
Defines the category of an iterator. Each tag is an empty type and corresponds to one of the five (un...
Definition tags.hpp:37