Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:37:41

0001 /*!
0002 @file
0003 Defines `boost::hana::detail::variadic::reverse_apply_flat`.
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_DETAIL_VARIADIC_REVERSE_APPLY_FLAT_HPP
0011 #define BOOST_HANA_DETAIL_VARIADIC_REVERSE_APPLY_FLAT_HPP
0012 
0013 #include <boost/hana/config.hpp>
0014 #include <boost/hana/detail/variadic/at.hpp>
0015 
0016 #include <utility>
0017 
0018 
0019 namespace boost { namespace hana { namespace detail { namespace variadic {
0020     template <int ...i, typename F, typename ...X>
0021     constexpr decltype(auto)
0022     reverse_apply_flat_helper(std::integer_sequence<int, i...>, F&& f, X&& ...x)
0023     {
0024         return static_cast<F&&>(f)(
0025             detail::variadic::at<sizeof...(x) - i - 1>(
0026                 static_cast<X&&>(x)...
0027             )...
0028         );
0029     }
0030 
0031     template <typename F, typename ...X>
0032     constexpr decltype(auto) reverse_apply_flat(F&& f, X&& ...x) {
0033         return reverse_apply_flat_helper(
0034             std::make_integer_sequence<int, sizeof...(x)>{},
0035             static_cast<F&&>(f),
0036             static_cast<X&&>(x)...
0037         );
0038     }
0039 }} }} // end namespace boost::hana
0040 
0041 #endif // !BOOST_HANA_DETAIL_VARIADIC_REVERSE_APPLY_FLAT_HPP