Quote:
A read-only iterator implies that it's constant. I don't see anything wrong with only providing a constant iterator.
A const iterator is supposed to return "const T&" from operator* and "const T*" from operator->. I don't want these references to be const, it should be possible to modify the underlying object. Or maybe I could use const anyway, since the object itself isn't modified, just the key it represents. Hmmm...
It just shouldn't be possible to assign to it.
Quote:
After reading your post a few more times, it sounds like you're looking for some design guidance on how to make the iterator writable, which would result in a registry key being modified based on that write/access - correct?
No, I want the underlying objects to modify the registry, but the objects themselves to be immutable.
Quote:
Then don't return a reference, return a copy. After all, it's the registry that you want to modify in the end.
Can't return a copy from operator->.
Quote:
Is there anything inparticular in STL that you want you interators to be compatible with? Something out of <algorithm> perhaps?
Not any particular algorithms except perhaps foreach and copy.