为什么在这种情况下不调用复制构造函数?
class A{public: A(int value) : value_(value) { cout <<"Regular constructor" <<endl; } A(const A& other) : value_(other.value_) { cout <<"Copy constructor" <<endl; }private: int value_;};int main(){ A a = A(5);}
A a(5);
回首忆惘然
慕勒3428872
相关分类