Guest User

Untitled

a guest
Jan 22nd, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. void foo(std::string&& s);
  2. void bar(std::string&& s) {
  3.  
  4. foo(s);
  5.  
  6. // continue to use s...
  7. // oops, s might have been moved
  8. }
  9.  
  10. void bar(std::string&& s) {
  11.  
  12. foo(std::move(s));
  13.  
  14. // we know that s might have been moved
  15. }
Add Comment
Please, Sign In to add comment