new operaor | operator new 定位 new?

来源:互联网 发布:php邮箱的正则表达式 编辑:程序博客网 时间:2024/04/29 22:18

operator new : 只分配内存空间

new operator :分配内存空间,并调用相关构造函数初始化内存

定位new:在已经分配的内存中初始化一个对象

new (place_address) type

new(place_address) type (initializer-list)

place_address必须是个指针 initializer-list(可能为空)提供初始化列表

可以等价于construct(first_free, t);

new(first_free) T(t);