摘要: 代码如下,按理应该调用复制运算符啊,为何却是调用了复制构造函数: 1 #include 2 using std::cout; 3 using std::endl; 4 using std::string; 5 6 class Test 7 { 8 public: 9 Test()10 { 11 cout << "The default constructor is called!" << endl;12 } 13 14 Test(const Test &rhs)15 :strTest(rhs.strTest)16 { ... 阅读全文
posted @ 2014-04-10 00:18 百里飞猫 阅读(224) 评论(0) 推荐(0)