Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It's actually really easy...

std::vector<int> a = {1,2,3};

// Added this without thinking about future uses of a.

std::vector<int> b = std::move(a);

use_vec(b);

// ...

use_vec(a);



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: