Created
May 23, 2016 21:21
-
-
Save steveobbayi/3543e68b834d19728e813bfa4e763992 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vector<int> src = {2,5,3}; // our source of data | |
vector<int> dest = {0,0,0,0,0,0,0,0,0,0}; // array to be modified | |
// Lets move all of src to dest | |
move(src.begin(), src.end(),dest.begin()); | |
// dest is now {2,5,3,0,0,0,0,0,0,0} | |
// src is now undefined | |
//lets move src to the end of dest assuming its redefined | |
move_backward(src.begin(), src.end(),dest.end()); | |
//dest is now {0,0,0,0,0,0,0,2,5,3} | |
// src is now undefined |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment