Skip to content

Instantly share code, notes, and snippets.

@LoganBarnett
Last active August 29, 2015 14:23
Show Gist options
  • Save LoganBarnett/65ddfefd95eb1cb33dd9 to your computer and use it in GitHub Desktop.
Save LoganBarnett/65ddfefd95eb1cb33dd9 to your computer and use it in GitHub Desktop.
Post incremental hell
int foo = 0;
int bar = foo++;
print(foo); // <= ?
print(bar); // <= ?
// 5,000,000 ints of 10
std::vector<int> stuff(5000000, 10);
// do you know what's in the var 'it'? Is it safe to copy lots and lots?
for (std::vector<int>::iterator it = stuff.begin(); it != stuff.end(); it++) {
std::cout << ' ' << *it;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment