std::allocator::construct
来自cppreference.com
|
|
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
| Defined in header <memory>
|
||
| void construct( pointer p, const_reference val ); |
(至 C++11) | |
| template< class U, class... Args > void construct( U* p, Args&&... args ); |
(C++11 起) | |
构造一个对象分配的未初始化存储类型
1) T指出,p,使用放置新的Original:
Constructs an object of type
T in allocated uninitialized storage pointed to by p, using placement-newThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
调用new((void *)p) T(val)
2) Original:
Calls new((void *)p) T(val)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
调用::new((void *)p) U(std::forward<Args>(args)...)
Original:
Calls ::new((void *)p) U(std::forward<Args>(args)...)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[编辑] 参数
| p | - | 指针分配的未初始化存储
Original: pointer to allocated uninitialized storage The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
| val | - | 使用拷贝构造函数的参数值
Original: the value to use as the copy constructor argument The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
| args... | - | 构造函数的参数使用
Original: the constructor arguments to use The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
[编辑] 返回值
(无)
Original:
(none)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[编辑] 另请参阅
| [静态的] </ SPAN></div></div>
|
构造一个对象分配的存储空间 Original: constructs an object in the allocated storage The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (函数模板) |
| 分配的功能 Original: allocation functions The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (函数) | |