提交 c809fee3 编写于 作者: Y yuyang

Fix bug of Vector::Extend

上级 def2a8b1
...@@ -182,7 +182,7 @@ class Vector { ...@@ -182,7 +182,7 @@ class Vector {
void Extend(It begin, It end) { void Extend(It begin, It end) {
MutableCPU(); MutableCPU();
cpu_.reserve((end - begin) + cpu_.size()); cpu_.reserve((end - begin) + cpu_.size());
std::copy(begin, end, cpu_.begin()); std::copy(begin, end, std::back_inserter<std::vector<T>>(cpu_));
} }
// resize the vector // resize the vector
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册