c++ - 一段源码的注释,不知道它说的是什么意思(我会翻译,我说的是这句话该这么理解,不是让你们翻译的。。。。),?
阿神
阿神 2017-04-17 15:30:35
0
2
571

Note that standard-conforming allocators use many language features that are not yet widely implemented. In particular, they rely on member templates, partial specialization, partial ordering of function templates, the typename keyword, and the use of the template keyword to refer to a template member of a dependent type.

就是加粗部分,求解释,想不明白。

阿神
阿神

闭关修行中......

全部回复(2)
洪涛

粗体在这句话中的意义是:与标准库相符的allocator依赖于"partial ordering of function templates"和"the use of the template keyword to refer to a template member of a dependent type"这两个c++特性。

partial ordering实际上用了模板就要走一遍,template关键字用在allocator的rebind上。这句话想说实现与标准相符的allocator没办法避开这些特性,但是这些特性目前移植性不好。(参考一下注释的年份,我在某cryengine里找到了相同的注释,最后更新于2012年)

When the same function template specialization matches more than one overloaded function template (this often results from template argument deduction), partial ordering of overloaded function templates is performed to select the best match.[...]

参照 Function template overloading

Similarly, in a template definition, a dependent name that is not a member of the current instantiation is not considered to be a template name unless the disambiguation keyword template is used or unless it was already established as a template name:[...]

参照 The template disambiguator for dependent names

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责声明 Sitemap
PHP中文网:公益在线PHP培训,帮助PHP学习者快速成长!