Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.