One thing I’ve always liked about C++ is that when using the Standard Template Library, you can write loops over containers (or really between any range of iterators) very cleanly and simply, e.g.:
for (vector::iterator i = myVector.begin(); i != myVector.end(); ++i) {
// do something with *i
}
On the other hand, whenever I use Cocoa NSEnumerator
objects, it drives me batty:
Continue reading