std::set< int > numbers;Update (23:40): John gave a correct answer in the comments.
for (int i = 0; i < 10; i++)
numbers.insert(i);
for (std::set< int >::iterator iter = numbers.begin();
iter != numbers.end(); iter++) {
int& i = *iter;
i++;
}
February 8, 2008 · About 1 minutes
std::set< int > numbers;Update (23:40): John gave a correct answer in the comments.
for (int i = 0; i < 10; i++)
numbers.insert(i);
for (std::set< int >::iterator iter = numbers.begin();
iter != numbers.end(); iter++) {
int& i = *iter;
i++;
}
Comments from the original Blogger-hosted post: