You cannot directly call a class constructor. If you cannot deduce the arguments of the constructor template from the call, then this particular constructor cannot be called.
What you can do is create some kind of wrapper that can be used for zero-load output:
template <typename T>
struct type_wrapper { };
template<typename T>
struct A
{
template<typename U>
A(type_wrapper<U>) {}
};
int main()
{
auto a = A<int>(type_wrapper<double>{});
}
live example in wandbox
source
share