我无法解析以下代码行的含义:
typedef typename Allocator::template rebind<Mapped>::other mapped_type_allocator;
这是分配器重新绑定的代码(第 63 行https://gcc.gnu.org/onlinedocs/libstdc++/libstdc++-api-4.5/a00756_source.html https://gcc.gnu.org/onlinedocs/libstdc++/libstdc++-api-4.5/a00756_source.html)
这与下面的有什么不同?
typedef typename Allocator::rebind<Mapped>::other mapped_type_allocator;
在这里,我在单独的行中显示了该声明的分组:
typedef mapped_type_allocator;
typename Allocator:: ::other
template rebind<Mapped>
关键词typename
and template
它们后面有空格,这可能会让您感到困惑。关于使用这两个关键字的原因,请参阅我必须在哪里以及为什么必须放置“template”和“typename”关键字? https://stackoverflow.com/questions/610245/where-and-why-do-i-have-to-put-the-template-and-typename-keywords .
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)