Hello,
Could someone give me a dumbed down version of why a compiler can't deduce dependent names.
I kind of got the impression that:
1. The compiler can't get the template parameters from a function/class untill that function/class is initialized.
2 Inorder to initialize a function/class you need to figure out what it's dependent names are.
3. And of course you need the template parameter inorder to figure out what a dependent name is.
Item 1: The correct term is "instantiated".
Item 2: I'm not sure I understand what you mean by "dependent names".
Assuming that T is a type parameter, you have to instantiate a template with a specific type. When you write the template, you use T to represent the type that was passed when the template was instantiated. i.e. The compiler substitutes the type name for T.
When you write the template, you use T to represent the type that was passed when the template was instantiated. i.e. The compiler substitutes the type name for T.
And at that time it would also be possible to know what std::vector<T>::value_type is, but not before that.
I'd guess that C++ doesn't support this (at least) because it would need fundamental changes to support a solution.
For instance see the abstract of this paper: https://www.moskal.me/pdf/msc.pdf