clover/util: Fix construction of compat::vector with a general container as argument.

This commit is contained in:
Francisco Jerez 2014-10-08 20:01:26 +03:00
parent 73dd50acf6
commit 1441a3c1bb

View file

@ -80,8 +80,10 @@ namespace clover {
template<typename C>
vector(const C &v) :
p(alloc(v.size(), &*v.begin(), v.size())),
_size(v.size()) , _capacity(v.size()) {
p(alloc(v.size(), NULL, 0)), _size(0),
_capacity(v.size()) {
for (typename C::const_iterator it = v.begin(); it != v.end(); ++it)
new(&p[_size++]) T(*it);
}
~vector() {