This does not build. Can you guess why? Without testing it?
std::set< int > numbers;

for (int i = 0; i < 10; i++)

for (std::set< int >::iterator iter = numbers.begin();
iter != numbers.end(); iter++) {
int& i = *iter;
Update (23:40): John gave a correct answer in the comments.

A blog on operating systems, programming languages, testing, build systems, my own software projects and even personal productivity. Specifics include FreeBSD, Linux, Rust, Bazel and EndBASIC.

Follow @jmmv on Mastodon
Follow @jmmv on Twitter
RSS feed
0 subscribers