/*============================================================================= Copyright (c) 2011-2013 Bolero MURAKAMI https://github.com/bolero-MURAKAMI/Sprout Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) =============================================================================*/ #ifndef SPROUT_UTILITY_PACK_HPP #define SPROUT_UTILITY_PACK_HPP #include #include #include #include #include #include namespace sprout { // // pack_element // template struct pack_element : public std::tuple_element > {}; // // pack_element_c // template struct pack_element_c : public sprout::pack_element...>::type {}; // // pack_get // namespace detail { template struct pack_get_helper; template struct pack_get_helper > { template static SPROUT_CONSTEXPR Head&& eval(Args&&..., Head&& head, Tail&&...) { return sprout::forward(head); } }; } // namespace detail template inline SPROUT_CONSTEXPR typename sprout::pack_element::type pack_get(Args&&... args) { return sprout::detail::pack_get_helper< typename sprout::types::detail::tuple_take >::type >::eval(sprout::forward(args)...); } } // namespace sprout #endif // #ifndef SPROUT_UTILITY_PACK_HPP