move
对象之后,新旧对象之间有依赖关系吗?int main () {
int a = 100;
std::cout<<&a<<std::endl;
auto a_copy = a; // deduced as int
std::cout<<&a_copy<<std::endl;
auto a_move = std::move(a); // deduced as int
std::cout<<&a_move<<std::endl;
};
输出:
0x7fffffffe094
0x7fffffffe098
0x7fffffffe09c
https://stackoverflow.com/questions/27888873
复制相似问题