vector temp1;
temp1.resize(10,2);
vectortemp2;
temp2=std::move(temp1);
although temp1.size() is 0,but temp1.reserve(10);
重新使用变量。
struct中出现的vector ,变量名占用16字节,因为内存全部放在栈空间。
std::move使用心得
最新推荐文章于 2022-08-12 18:22:58 发布
vector temp1;
temp1.resize(10,2);
vectortemp2;
temp2=std::move(temp1);
although temp1.size() is 0,but temp1.reserve(10);
重新使用变量。
struct中出现的vector ,变量名占用16字节,因为内存全部放在栈空间。