【发布时间】:2014-12-06 16:54:32
【问题描述】:
如果我有两个包含 std::unique_ptr 的向量,有没有办法将向量 b 添加到向量 a 的末尾,从而删除向量 b?
例如:
std::unique_ptr<std::vector<int>> a(&someintvector);
std::unique_ptr<std::vector<int>> b(&someotherintvector);
如何将向量 b 移动到向量 a 的末尾?
【问题讨论】:
-
也许this 可以帮助您,但我不确定
unique_ptr在您的代码中的作用。
标签: c++ pointers c++11 vector stl