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_DROP_INTO_HPP
0011 #define BOOST_HANA_DETAIL_VARIADIC_DROP_INTO_HPP
0012
0013 #include <boost/hana/config.hpp>
0014
0015 #include <cstddef>
0016 #include <utility>
0017
0018
0019 namespace boost { namespace hana { namespace detail { namespace variadic {
0020 template <std::size_t n, typename F, typename = std::make_index_sequence<n>>
0021 struct dropper;
0022
0023 template <std::size_t n, typename F, std::size_t ...ignore>
0024 struct dropper<n, F, std::index_sequence<ignore...>> {
0025 F f;
0026
0027 template <typename ...Rest>
0028 constexpr auto go(decltype(ignore, (void*)0)..., Rest ...rest) const
0029 { return f(*rest...); }
0030
0031 template <typename ...Xs>
0032 constexpr auto operator()(Xs ...xs) const
0033 { return go(&xs...); }
0034 };
0035
0036 template <std::size_t n>
0037 struct make_dropper {
0038 template <typename F>
0039 constexpr auto operator()(F f) const
0040 { return dropper<n, decltype(f)>{f}; }
0041 };
0042
0043 template <std::size_t n>
0044 BOOST_HANA_INLINE_VARIABLE constexpr make_dropper<n> drop_into{};
0045 }} }}
0046
0047 #endif