C++ 概念: CopyInsertable

来自cppreference.com
< cpp‎ | concept

指定的类型的一个实例可以复制构造的地方,在未初始化的存储.
原文:
Specifies that an instance of the type can be copy-constructed in-place, in uninitialized storage.
这段文字是通过 Google Translate 自动翻译生成的。
您可以帮助我们检查、纠正翻译中的错误。详情请点击这里

[编辑] 要求

如果给定的类型TCopyInsertable放入容器中X
原文:
The type T is CopyInsertable into the container X if, given
这段文字是通过 Google Translate 自动翻译生成的。
您可以帮助我们检查、纠正翻译中的错误。详情请点击这里
A
的分配器类型定义为X::allocator_type
原文:
the allocator type defined as X::allocator_type
这段文字是通过 Google Translate 自动翻译生成的。
您可以帮助我们检查、纠正翻译中的错误。详情请点击这里
m
左值的类型AX::get_allocator()
原文:
the lvalue of type A obtained from X::get_allocator()
这段文字是通过 Google Translate 自动翻译生成的。
您可以帮助我们检查、纠正翻译中的错误。详情请点击这里
p
指针类型T*制备的容器
原文:
the pointer of type T* prepared by the container
这段文字是通过 Google Translate 自动翻译生成的。
您可以帮助我们检查、纠正翻译中的错误。详情请点击这里
v
表达的类型T,作为参数提供的push_back()等
原文:
expression of type T, provided as the argument to push_back(), etc
这段文字是通过 Google Translate 自动翻译生成的。
您可以帮助我们检查、纠正翻译中的错误。详情请点击这里
下面的表达式是良好的
原文:
the following expression is well-formed:
这段文字是通过 Google Translate 自动翻译生成的。
您可以帮助我们检查、纠正翻译中的错误。详情请点击这里

std::allocator_traits<A>::construct(m, p, v);

需要注意的是,如果Astd::allocator<T>,那么这将调用新的投放,通过::new((void*)p) T(v)
原文:
Note that if A is std::allocator<T>, then this will call placement-new, as by ::new((void*)p) T(v)
这段文字是通过 Google Translate 自动翻译生成的。
您可以帮助我们检查、纠正翻译中的错误。详情请点击这里