标签: c++
假设foo类没有重载的赋值运算符。为两个a = b;对象分配foo时会发生什么? 选项是:
foo
a = b;
答案 0 :(得分:4)
取决于:
A a; //this is not an assignment, it is equivalent to A b(a); A b = a; //default copy constructor is called A c; //assignment c = a; //default assignment operator is called