1

Code where type deduction is wrapped method

struct InterfaceOverriderFactory
{
    template <typename Interface>
    decltype(auto) operator()(Type<Interface>) const noexcept
    {
         return typename FunctionArguments::InvokeOperatorArguments<Interface>{};
    }
};

Alias(is used as deduction guide)

template <typename Interface, typename Code>
using IO = typename std::invoke_result_t<InterfaceOverriderFactory, Type<Interface>>::PushFront<Code>::PushFront<Interface>::WithT<InterfaceOverrider>;

Same code, but without wrapping it in method

template <typename Interface, typename Code>
using IO = typename FunctionArguments::InvokeOperatorArguments<Interface>::PushFront<Code>::PushFront<Interface>::WithT<InterfaceOverrider>;

Both code snippets are used in

template <typename ...Interfaces, typename ...Codes>
Strategy(std::pair<type::Type<Interfaces>, Codes>...) -> Strategy<type::IO<Interfaces, Codes>...>;

For code where type is deduced via method I've got Strategy<SomeTypes...>

For direct alias - Strategy<>

This code returns struct that is holding types, via template <typename... Args>

FunctionArguments::InvokeOperatorArguments<Interface>

So, I want to make code in paragraph "Same code, but without wrapping it in method" work or if it is not possible to know why

Nufun
  • 58
  • 4
  • Could [std::invoke](https://en.cppreference.com/w/cpp/utility/functional/invoke) be of help? – Eljay Mar 20 '22 at 20:50
  • @Eljay If you mean replace std::invoke_result_t with std::invoke - it will not solve the problem. I want to get rid of InterfaceOverriderFactory. For some reason code `FunctionArguments::InvokeOperatorArguments` works differently when used in method and alias – Nufun Mar 20 '22 at 21:08

0 Answers0