#ifndef TYPEASVALUE_SRC_FUNCTION_DETAIL_APPLY_H_ #define TYPEASVALUE_SRC_FUNCTION_DETAIL_APPLY_H_ #include #include "list/list.h" #include "list/operation/nth.h" #include "list/operation/higher/query.h" namespace tav { namespace detail { struct placeholder_tag { }; template using is_placeholder = Eval>; template struct placeholder : placeholder_tag { }; template struct resolve_placeholder { typedef Argument type; }; template < typename Partials, int Index > struct resolve_placeholder> { typedef Nth, Partials> type; }; template using count_placeholders = Count>; template < template class Function, typename... Arguments > struct apply_none { using function = Function; }; template < template class Function, typename... Arguments > struct apply_variadic { template using function = Function< Eval, Arguments >>... >; }; template < template class Function, typename... Arguments > struct apply_single : apply_variadic { template using function = typename apply_variadic< Function, Arguments... >::template function; }; template < template class Function, typename... Arguments > struct apply_pair : apply_variadic { template using function = typename apply_variadic< Function, Arguments... >::template function; }; } } #endif // TYPEASVALUE_SRC_FUNCTION_DETAIL_APPLY_H_