#ifndef KGR_KANGARU_INCLUDE_KANGARU_DETAIL_INVOKE_HPP #define KGR_KANGARU_INCLUDE_KANGARU_DETAIL_INVOKE_HPP #include #include "meta_list.hpp" #include "utils.hpp" #include "traits.hpp" #include "injected.hpp" namespace kgr { struct Container; template using Method = std::integral_constant; template struct Invoke : M { using Parameters = detail::meta_list; }; template class M, typename... Ts> struct AutoCall { using Autocall = detail::meta_list; template using Map = M; }; template struct AutoCallNoMap { using Autocall = detail::meta_list; }; namespace detail { template struct autocall_function { private: template static U identity(U); template struct get_member_autocall { using type = std::integral_constant< decltype(identity(&U::template autocall)), &U::template autocall >; }; template struct get_invoke_autocall { using type = std::integral_constant< decltype(identity(&U::template autocall...>)), &U::template autocall...> >; }; template static get_invoke_autocall test_helper(seq); template::value, int> = 0> static decltype(test_helper(tuple_seq{})) test(); template::value && !is_invoke_call::value, int> = 0> static get_member_autocall test(); using inner_type = decltype(test()); public: using type = typename inner_type::type; }; template struct autocall_arguments; template struct autocall_arguments::value>> { using type = typename F::Parameters; }; template struct autocall_arguments::value && !is_invoke_call::value>> { private: template class Map> struct mapped_type { template using map = service_map_t; }; public: using type = meta_list_transform_t, mapped_type::template map>; }; template using autocall_function_t = typename autocall_function::type; template using autocall_nth_function = detail::autocall_function_t>; template using autocall_nth_function_t = typename detail::autocall_function_t>::value_type; template using autocall_arguments_t = typename autocall_arguments::type; template using is_valid_autocall_function = std::integral_constant::value || is_member_autocall::value >; template struct map_entry {}; template struct map_entry(), std::declval >()))>::value>> { using Service = decltype(service_map(std::declval

(), std::declval >())); }; template struct map_entry()))>::value>> { using Service = decltype(service_map(std::declval

())); }; template struct map_entry(), std::declval >()))>::value>> : decltype(service_map(std::declval

(), std::declval >())) {}; template struct map_entry()))>::value>> : decltype(service_map(std::declval

())) {}; } // namespace detail template struct AdlMap : detail::map_entry

{}; } // namespace kgr #endif // KGR_KANGARU_INCLUDE_KANGARU_DETAIL_INVOKE_HPP