Template function inside template class
Write this: template <class T> template <class U> void MyClass<T>::foo() { /* … */ }
Write this: template <class T> template <class U> void MyClass<T>::foo() { /* … */ }
No. Whatever changes the paper will entail, which is little at this point, it cannot change the fact that a non-template function definition is only typed once. Moreover, if your proposed code would be legal, we could presumably find a way to declare a variable of type std::integral_constant<int, i>, which feels very prohibitive in terms … Read more
CTAD (Class Template Argument Deduction) is an all or nothing process currently. You either specify nothing and allow the compiler to deduce all of the arguments, or you specify all of the arguments taking the compiler out of the loop. There is a paper (P1021R0) which asks for this and more, but it has not … Read more