更新时间:2022-12-13 22:07:56
假定 a2
是 A
的实例,这将调用复制构造函数.
Assuming a2
is an instance of A
, this calls the copy constructor.
它将调用 operator new
来获取对象的动态内存,然后它将新对象复制-构造到内存中,然后返回指向该内存的指针.
It will call operator new
to get dynamic memory for the object, then it will copy-construct a new object into the memory, then return a pointer to that memory.