I am writing generic code, and I need to call the constructor of a generic template parameter T
with a generic variadic tuple of arguments:
T& init_and_return(ArgsTuple& args)
{
m_data = std::apply(&T::T, args); // here compiler complains
return m_data;
}
In my main, T
will be a type called A
.
Compiler is saying "no member named T
in A
".
How can I refer to the constructor of T
in a generic way?