c++ - 模板的隐式特化是什么意思?

标签 c++ templates

在章节N3797::14/4 [temp] (强调我的)

A template name has linkage (3.5). A non-member function template can have internal linkage; any other template name shall have external linkage. Specializations (explicit or implicit) of a template that has internal linkage are distinct from all specializations in other translation units.

提到了隐式特化。据我从上下文中了解,该概念不同于模板显式特化,后者具有

template < > 声明

语法。所以,我猜测隐式特化与部分类模板特化有关。不幸的是,我无法在当前的工作草案中规范性地引用定义隐式特化概念。

最佳答案

没有称为“隐式特化”的规范术语。
然而,我相信,在这种情况下,它意味着“显式特化”的补充:用户未明确特化的每个特化,换句话说,实例化特化
考虑一下有

  • 明确的特化
  • 隐式实例化
  • 显式实例化

通过后两者实例化的特化可以称为“隐式特化”。

关于c++ - 模板的隐式特化是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28669262/

相关文章:

c++ - 错误 : does not name a type (using auto)

c++ - 如何递归调用以结构数组为参数的函数

c++ - 嵌套类中的类实例化

ruby-on-rails - Rails 中 Django 模板的“无空间”等价物

javascript - templateUrl 与 AngularJS 中的模板

c++ - 单一定义规则是否强制创建单个静态函数变量?

c++ - 在 C++ 中实现相关类型之间自动类型转换的最佳方法是什么?

现有对象的指针/引用的 C++ 容器

c++ - Xcode 不打印日志/控制台消息。显示黑色调试器

c++ - 模板函数中的通用模板参数