第7章 站在对象模型的尖端

第7章 站在对象模型的尖端

7.1 Template

这一节的焦点放在template的语意上面, 下面是有关template的三个主要讨论方向:

  1. template的声明. 基本来说就是当声明一个template class, template class member function等等时, 会发生什么事情
  2. 如何"实例化(instantiates)"class objects, inline nonmember以及member template functions. 这些是"每一个编译单位都会拥有一份实例"的东西
  3. 如何"实例化(instantiates)"nonmember, member template functions以及static template class members. 这些都是"每一个可执行文件中只需要一份实例"的东西. 也就是一般而言的template所带来的问题

Template的"实例化"行为

待续

原文地址:https://www.cnblogs.com/hesper/p/10635232.html