Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:09:42

0001 /// \file
0002 // Range v3 library
0003 //
0004 //  Copyright Eric Niebler 2013-present
0005 //  Copyright Gonzalo Brito Gadeschi 2017
0006 //
0007 //  Use, modification and distribution is subject to the
0008 //  Boost Software License, Version 1.0. (See accompanying
0009 //  file LICENSE_1_0.txt or copy at
0010 //  http://www.boost.org/LICENSE_1_0.txt)
0011 //
0012 // Project home: https://github.com/ericniebler/range-v3
0013 //
0014 
0015 #ifndef RANGES_V3_ACTION_REVERSE_HPP
0016 #define RANGES_V3_ACTION_REVERSE_HPP
0017 
0018 #include <range/v3/range_fwd.hpp>
0019 
0020 #include <range/v3/action/action.hpp>
0021 #include <range/v3/algorithm/reverse.hpp>
0022 #include <range/v3/iterator/concepts.hpp>
0023 #include <range/v3/range/traits.hpp>
0024 #include <range/v3/utility/static_const.hpp>
0025 
0026 #include <range/v3/detail/prologue.hpp>
0027 
0028 namespace ranges
0029 {
0030     /// \addtogroup group-actions
0031     /// @{
0032     namespace actions
0033     {
0034         /// Reversed the source range in-place.
0035         struct reverse_fn
0036         {
0037             template(typename Rng)(
0038                 requires bidirectional_range<Rng> AND permutable<iterator_t<Rng>>)
0039             Rng operator()(Rng && rng) const
0040             {
0041                 ranges::reverse(rng);
0042                 return static_cast<Rng &&>(rng);
0043             }
0044         };
0045 
0046         /// \relates actions::reverse_fn
0047         /// \sa action_closure
0048         RANGES_INLINE_VARIABLE(action_closure<reverse_fn>, reverse)
0049     } // namespace actions
0050     /// @}
0051 } // namespace ranges
0052 
0053 #include <range/v3/detail/epilogue.hpp>
0054 
0055 #endif