Last active
June 13, 2018 07:47
-
-
Save tosik/d86ef43c286f56d7beae84536e48def1 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
g++ -std=c++11 foo.cpp | |
foo.cpp:11:63: error: cannot increment value of type 'const std::__1::__wrap_iter<const T *>' | |
for (const auto & it = foo.begin() ; it != foo.end() ; it ++); | |
~~ ^ | |
1 error generated. | |
make: *** [all] Error 1 |
This file contains hidden or 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
#include <vector> | |
class T | |
{ | |
}; | |
int main() | |
{ | |
const std::vector<T> foo = {}; | |
for (const auto & it = foo.begin() ; it != foo.end() ; it ++); | |
for (auto && it = foo.begin() ; it != foo.end() ; it ++); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment