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

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.

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

阿神
阿神

闭关修行中......

reply all(2)
洪涛

The meaning of bold in this sentence is: the allocator consistent with the standard library relies on "partial ordering of function templates" and "the use of the template keyword to refer to a template member of a dependent type" a c++ feature.

Partial ordering actually needs to be done once when using a template. The template keyword is used in the rebind of the allocator. This sentence means that implementing an allocator that conforms to the standard cannot avoid these features, but these features are currently not very portable. (Refer to the year of the comment, I found the same comment in a cryengine, last updated in 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.[ ...]

Refer to 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 :[...]

Refer to The template disambiguator for dependent names

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template