可能重复:
Template instantiation details of GCC and MS compilersC++模板内部
如何做一个C++编译器便于模板编程?我有兴趣了解编译器在模板编程中遵循的方案。
另外,根据C++模板,typename和class之间有什么区别?
可能重复:
Template instantiation details of GCC and MS compilersC++模板内部
如何做一个C++编译器便于模板编程?我有兴趣了解编译器在模板编程中遵循的方案。
另外,根据C++模板,typename和class之间有什么区别?
C++编译器如何促进模板编程?我有兴趣了解编译器在模板编程中遵循的方案。
模板实际上由编译器保存为某种宏,然后在专门化时应用扩展(模板部分替换为给定值),应用模板中指定的约束检查。
另外,根据C++模板,typename和class之间有什么区别?
没有区别,除非你使用模板,模板参数:
template <template <typename> class T>
...
不能
template <template <typename> typename T>
// ^^^^^^^^ wrong
...
2. http://stackoverflow.com/questions/2023977/c-difference-of-keywords-typename-and-class-in-templates – Pubby
Thx为我指出了Pubby&德米特里。不知何故,我无法找到一个领先的。 –