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

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 funcing of overloaded funcing. ...]

參考 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 tempused or unless name readununblates template is name or ununless :[...]

參考 The template disambiguator for dependent names

熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!