-
-
Save fabiogaluppo/e288286749a6bb58b06b 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
std::iota(xs.begin(), xs.end(), 1); //xs = 1 2 3 4 5 6 7 8 9 10 | |
std::iota(xs.begin(), xs.end(), 10); //xs = 10 11 12 13 14 15 16 17 18 19 | |
std::fill(xs.begin(), xs.end(), 0); | |
std::iota(xs.begin(), xs.begin() + xs.size() / 2, 1); //xs = 1 2 3 4 5 0 0 0 0 0 | |
std::iota(xs.rbegin(), xs.rend(), 0); //xs = 9 8 7 6 5 4 3 2 1 0 | |
std::iota(xs.rbegin(), xs.rend(), 100); //xs = 109 108 107 106 105 104 103 102 101 100 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment