#ifndef TYPEASVALUE_SRC_FUNCTION_APPLY_H_ #define TYPEASVALUE_SRC_FUNCTION_APPLY_H_ #include #include "list/list.h" #include "list/operation/nth.h" namespace tav { namespace detail { struct placeholder_tag { }; template using is_placeholder = tav::Boolean< std::is_base_of::value >; template struct placeholder : placeholder_tag { }; template < typename Partials, typename Argument > struct resolve_placeholder { typedef Argument type; }; template < typename Partials, int Index > struct resolve_placeholder> { typedef typename Nth, Partials>::type type; }; } typedef detail::placeholder<0> _0; typedef detail::placeholder<1> _1; typedef detail::placeholder<2> _2; typedef detail::placeholder<3> _3; template < template class Function, typename... Arguments > struct Apply { template using variadic_type = Function< typename detail::resolve_placeholder< typename tav::List::type, Arguments >::type... >; template using single_type = variadic_type; template using pair_type = variadic_type; template using triple_type = variadic_type; }; } #endif // TYPEASVALUE_SRC_FUNCTION_APPLY_H_