Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:38:05

0001 /*!
0002 @file
0003 Defines `boost::hana::reverse_fold`.
0004 
0005 Copyright Louis Dionne 2013-2022
0006 Distributed under the Boost Software License, Version 1.0.
0007 (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
0008  */
0009 
0010 #ifndef BOOST_HANA_REVERSE_FOLD_HPP
0011 #define BOOST_HANA_REVERSE_FOLD_HPP
0012 
0013 #include <boost/hana/fwd/reverse_fold.hpp>
0014 
0015 #include <boost/hana/config.hpp>
0016 #include <boost/hana/fold_right.hpp>
0017 #include <boost/hana/functional/flip.hpp>
0018 
0019 
0020 namespace boost { namespace hana {
0021     //! @cond
0022     template <typename Xs, typename S, typename F>
0023     constexpr decltype(auto) reverse_fold_t::operator()(Xs&& xs, S&& s, F&& f) const {
0024         return hana::fold_right(static_cast<Xs&&>(xs),
0025                                 static_cast<S&&>(s),
0026                                 hana::flip(static_cast<F&&>(f)));
0027     }
0028 
0029     template <typename Xs, typename F>
0030     constexpr decltype(auto) reverse_fold_t::operator()(Xs&& xs, F&& f) const {
0031         return hana::fold_right(static_cast<Xs&&>(xs),
0032                                 hana::flip(static_cast<F&&>(f)));
0033     }
0034     //! @endcond
0035 }} // end namespace boost::hana
0036 
0037 #endif // !BOOST_HANA_REVERSE_FOLD_HPP