看到这么一句
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表示你跟编译器说明要使用模版工具项,仅仅是一个通知或者声明而已!

相关文章:

  • 2021-10-29
  • 2022-03-07
  • 2021-11-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-10-29
  • 2022-12-23
  • 2022-02-08
  • 2021-12-10
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案