Last active
December 30, 2018 20:21
-
-
Save pohka/52e79fe8490cd65562eb5bf0ae89f2de to your computer and use it in GitHub Desktop.
C++ iteration
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::string str; | |
//slow | |
for(unsigned int i=0; i<str.size(); i++) | |
//slow | |
for (auto it = str.begin(); it != str.begin(); it++) | |
//mega fast | |
for(char& ch : str) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment