摘要:
移动构造函数 1. 移动构造函数示例: #include<iostream> #include<vector> #include<string> using namespace std; class Test { public: Test(const string& s = "hello world 阅读全文
摘要:
一、什么是拷贝构造函数 首先对于普通类型的对象来说,它们之间的复制是很简单的,例如: int a = 100; int b = a; 而类对象与普通对象不同,类对象内部结构一般较为复杂,存在各种成员变量。 下面看一个类对象拷贝的简单例子: 1 #include<iostream> 2 using n 阅读全文