1 year ago
#314329
Nufun
Type is deducted successfully when is wrapped in method, but not when used in direct alias
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
c++
alias
template-meta-programming
deduction-guide
0 Answers
Your Answer