最佳答案
这段代码是用 C + + 20(使用 gcc 10.1)编译的,没有在依赖类型 std::vector<T>::iterator
之前使用 typename
关键字。为什么要编译?
#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>;
}