搜尋

首頁  >  問答  >  主體

c++ - 一段源码的注释,不知道它说的是什么意思(我会翻译,我说的是这句话该这么理解,不是让你们翻译的。。。。),?

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.

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

阿神阿神2813 天前611

全部回覆(2)我來回復

  • PHP中文网

    PHP中文网2017-04-17 15:32:35

    粗體在這句話中的意義是:與標準庫相符的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

    回覆
    0
  • PHPz

    PHPz2017-04-17 15:32:35

    回覆
    0
  • 取消回覆