Horizon
reverse.hpp
Go to the documentation of this file.
1 // Range v3 library
3 //
4 // Copyright Eric Niebler 2013-present
5 // Copyright Gonzalo Brito Gadeschi 2017
6 //
7 // Use, modification and distribution is subject to the
8 // Boost Software License, Version 1.0. (See accompanying
9 // file LICENSE_1_0.txt or copy at
10 // http://www.boost.org/LICENSE_1_0.txt)
11 //
12 // Project home: https://github.com/ericniebler/range-v3
13 //
14 
15 #ifndef RANGES_V3_ACTION_REVERSE_HPP
16 #define RANGES_V3_ACTION_REVERSE_HPP
17 
18 #include <range/v3/range_fwd.hpp>
19 
24 #include <range/v3/utility/static_const.hpp>
25 
26 #include <range/v3/detail/prologue.hpp>
27 
28 namespace ranges
29 {
32  namespace actions
33  {
35  struct reverse_fn
36  {
37  template(typename Rng)(
38  requires bidirectional_range<Rng> AND permutable<iterator_t<Rng>>)
39  Rng operator()(Rng && rng) const
40  {
41  ranges::reverse(rng);
42  return static_cast<Rng &&>(rng);
43  }
44  };
45 
49  } // namespace actions
51 } // namespace ranges
52 
53 #include <range/v3/detail/epilogue.hpp>
54 
55 #endif
CPP_concept permutable
\concept permutable
Definition: concepts.hpp:840
decltype(begin(declval(Rng &))) iterator_t
Definition: access.hpp:698
RANGES_INLINE_VARIABLE(detail::to_container_fn< detail::from_range< std::vector >>, to_vector) template< template< typename... > class ContT > auto to(RANGES_HIDDEN_DETAIL(detail
For initializing a container of the specified type with the elements of an Range.
Definition: conversion.hpp:399
Definition: action.hpp:141
Reversed the source range in-place.
Definition: reverse.hpp:36