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.
就是加粗部分,求解释,想不明白。
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年)
參考 Function template overloadingWhen 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. ...]
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