|
容器都有构造函数的啊!
explicit vector(const A& al = A());
explicit vector(size_type n, const T& v = T(), const A& al = A());
vector(const vector& x);
vector(const_iterator first, const_iterator last,
const A& al = A());
list也是如此。
由于你声明时估计只是vector<int>ivec;
那么A就取了默认的allocator<int>
也就是说typedef A allocator<int>;
那么构造函数会是第一个:explicit vector(allocator<int> a);
The first constructor specifies an empty initial controlled sequence. //所以为0
The second constructor specifies a repetition of n elements of value x.
The third constructor specifies a copy of the sequence controlled by x.
The last constructor specifies the sequence [first, last). |
|