13 #ifndef RANGES_V3_ALGORITHM_REVERSE_HPP
14 #define RANGES_V3_ALGORITHM_REVERSE_HPP
25 #include <range/v3/utility/static_const.hpp>
28 #include <range/v3/detail/prologue.hpp>
39 constexpr
void reverse_impl(I
first, I last, std::bidirectional_iterator_tag)
45 ranges::iter_swap(
first, last);
51 constexpr
void reverse_impl(I
first, I last, std::random_access_iterator_tag)
55 ranges::iter_swap(
first, last);
60 RANGES_FUNC_BEGIN(reverse)
65 constexpr I RANGES_FUNC(reverse)(I
first, S end_)
67 I last = ranges::next(
first, end_);
68 detail::reverse_impl(
first, last, iterator_tag_of<I>{});
74 requires bidirectional_range<Rng> AND permutable<I>)
75 constexpr borrowed_iterator_t<Rng> RANGES_FUNC(reverse)(Rng && rng)
77 return (*
this)(begin(rng), end(rng));
80 RANGES_FUNC_END(reverse)
84 using ranges::reverse;
89 #include <range/v3/detail/epilogue.hpp>
template(typename Rng, typename I=iterator_t< Rng >)(requires bidirectional_range< Rng > AND permutable< I >) const expr borrowed_iterator_t< Rng > RANGES_FUNC(reverse)(Rng &&rng)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: reverse.hpp:73
CPP_concept permutable
\concept permutable
Definition: concepts.hpp:840
CPP_concept sentinel_for
\concept sentinel_for
Definition: concepts.hpp:306
CPP_concept bidirectional_iterator
\concept bidirectional_iterator
Definition: concepts.hpp:390
decltype(begin(declval(Rng &))) iterator_t
Definition: access.hpp:698
front< Pair > first
Retrieve the first element of the pair Pair.
Definition: meta.hpp:2251