/*! @file Defines `boost::hana::detail::variadic::take`. @copyright Louis Dionne 2013-2016 Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_HANA_DETAIL_VARIADIC_TAKE_HPP #define BOOST_HANA_DETAIL_VARIADIC_TAKE_HPP #include #include #include #include #include BOOST_HANA_NAMESPACE_BEGIN namespace detail { namespace variadic { struct take_impl2 { template constexpr decltype(auto) operator()(F&& f, Xs&& ...xs) const { return static_cast(f)(static_cast(xs)...); } }; struct take_impl1 { template constexpr auto operator()(Xs&& ...xs) const { return hana::always( reverse_partial(take_impl2{}, static_cast(xs)...) ); } }; template struct take_t { template constexpr decltype(auto) operator()(Xs&& ...xs) const { return variadic::split_at(static_cast(xs)...)(take_impl1{}); } }; template constexpr take_t take{}; }} BOOST_HANA_NAMESPACE_END #endif // !BOOST_HANA_DETAIL_VARIADIC_TAKE_HPP