std::allocator_traits::select_on_container_copy_construction

定义于头文件 <memory>
static Alloc select_on_container_copy_construction( const Alloc& a );
(C++11 起)

若可能,则获得分配器 a 的赋值构造函数版本,通过调用 a.select_on_container_copy_construction() 。若上述不可行(例如 a 无成员函数 select_on_container_copy_construction() ),则返回不修改的 a

此函数为所有标准库容器的复制构造函数所调用。它允许构造函数参数所用的分配器为正在复制的容器所具备,并在需要的情况下修改状态。

参数

a - 标准容器用以传递给容器复制构造函数的分配器

返回值

复制构造的标准容器所用的分配器。

参阅

复制 scoped_allocator_adaptor 与其所有分配器的状态
(std::scoped_allocator_adaptor 的公开成员函数)

版本历史

  • (当前 | 先前 2017年6月4日 (日) 19:35Fruderica讨论 | 贡献. . (1,077字节) (-1,284). . (撤销)
  • 当前 | 先前 2013年7月2日 (二) 09:02P12bot讨论 | 贡献 . . (2,361字节) (-95). . (Use {{lc}}. Update links. Various fixes.) (撤销)
  • 当前 | 先前 2012年11月2日 (五) 16:42P12bot讨论 | 贡献 . . (2,456字节) (+585). . (r2.7.3) (机器人添加:de, en, es, fr, it, ja, pt, ru) (撤销)
  • 当前 | 先前 2012年10月27日 (六) 03:25P12讨论 | 贡献 . . (1,871字节) (0). . (1个修订: Translate from the English version) (撤销)
  • 当前 | 先前 2012年10月26日 (五) 06:00TranslationBot讨论 | 贡献. . (1,871字节) (-34). . (Translated from the English version using Google Translate) (撤销)
  • 当前 | 先前 2012年10月25日 (四) 14:09P12讨论 | 贡献 . . (1,905字节) (0). . (1个修订: Translate from the English version) (撤销)
  • 当前 | 先前) 2012年10月25日 (四) 12:00TranslationBot讨论 | 贡献. . (1,905字节) (+1,905). . (Translated from the English version using Google Translate)