9.11
vector<int> vec; //空的
vector<int> vec(10); // 10个0
vector<int> vec(10, 1); // 10个1
vector<int> vec = { 1, 2, 3, 4, 5 };
vector<int> vec{ 1, 2, 3, 4, 5 }; // 1, 2, 3, 4, 5
vector<int> vec = other_vec;
vector<int> vec(other_vec); // 和other_vec一样
vector<int> vec(other_vec.begin(), other_vec.end()); // 和other_vec一样
9.12
接受容器的需要容器的类型和元素的类型相同,且拷贝后元素数量也一样。
而接受迭代器的版本:容器类型不一定一样,元素类型能相互转换也不需要一样,数量由迭代器决定。
9.13
list<int> l(10, 0);
vector<int> v(10, 1);
vector<double> dv(l.begin(), l.end());
vector<double> dv2(v.begin(), v.end());