c++ 调用模板函数时加template什么意思?

看到这么一句
stack_.template Top<ValueType>()->SetObjectRaw(members, (SizeType)memberCount, GetAllocator());

后面的不用管,只看
stack_.template Top<ValueType>();
为什么调用时还加template,不直接 stack_.Top<ValueType>() ;

Stack类定义
template <typename Allocator>
class Stack {
public:
template<typename T>
T* Top() {
xxxx
}
}

变量定义
Stack stack_<Allocator>;

声明template表示你跟编译器说明要使用模版工具项,仅仅是一个通知或者声明而已!
原文地址:https://www.cnblogs.com/zhoug2020/p/6260357.html