CopyInsertable
指定类型的实例可以由给定的分配器就地复制构造.
所需
类型T
是CopyInsertable
进入容器X
谁的value_type
是相同的T
如果T
是MoveInsertable
进X
,然后,给予。
A | an allocator type |
---|---|
m | an lvalue of type A |
p | the pointer of type T* prepared by the container |
v | expression of type (possibly const) T |
何地X::allocator_type
是相同的std::allocator_traits<A>::rebind_alloc<T>
,,,
下列表达式格式良好:
二次
std::allocator_traits<A>::construct(m, p, v);
二次
经评估后,*p
的值等于v
.的价值v
没有变化。
如果X
如果不知道分配器,则该术语的定义为A
成std::allocator<T>
,除非不需要创建分配器对象,并且用户定义的专门化为std::allocator
没有实例化。
注记
如果A
是std::allocator<T>
,然后这将称为安置-新的,如::new((void*)p) T(v)
...
© cppreference.com
在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。
本文档系腾讯云开发者社区成员共同维护,如有问题请联系 cloudcommunity@tencent.com