Why don't I need to specify “typename” before a dependent type in C++20?
问题 This bit of code compiled in C++20 (using gcc 10.1) without using the typename keyword before the dependent type std::vector<T>::iterator . Why does it compile? #include <vector> template<typename T> std::vector<T>::iterator // Why does this not require "typename" before it? f() { return {}; } int main() { auto fptr = &f<int>; } code playground 回答1: One of the new features in C++20 is Down with typename. In C++17, you had to provide the typename keyword in nearly all † dependent contexts to