#include <iostream>
using namespace std;
class Info
{
public:
Info() : m_iNumber(2)
{
}
Info(int iNumber) : m_iNumber(iNumber)
{
new (this)Info();
}
int m_iNumber;
};
int main(int argc, char *argv[])
{
Info* pInfo = new Info(123);
std::cout<<pInfo->m_iNumber;
return 0;
}
请问new (this)Info()这种语法是什么意思。虽然知道是调用无参的构造函数,但是(this)这种语法真没见过 = = |