Skip to content

Instantly share code, notes, and snippets.

@jake-low
Created April 15, 2015 17:31
Show Gist options
  • Save jake-low/ec3e9d8a198857c9f1d5 to your computer and use it in GitHub Desktop.
Save jake-low/ec3e9d8a198857c9f1d5 to your computer and use it in GitHub Desktop.
std::list<int> myList = { 4, 1, 2, 2, 9, 3 };
std::list<int>::const_iterator it = myList.begin();
if (it != myList.end()) {
printf("has an element");
while (++it != myList.end()) {
printf("has another element");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment