File indexing completed on 2025-01-18 09:37:41
0001
0002
0003
0004
0005
0006
0007
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 }} }}
0040
0041 #endif