> > I believe begin() should return a const iterator, you then assign it to a
> > non-const iterator ("it" above) and then inc/dec the copy.
>
> I doubt users would find that attractive. You would have to cast away
> const.
How so? We're making a copy, not modifying the original. As in (tested):
const vector<int>::iterator iter(vector<int>& vec) { return vec.begin(); }
int main() {
vector<int> vec;
vector<int>::iterator iv = iter(vec);
++iv;
}
> Furthermore, the Standard Library container requirements, table 65, require
> that the return type of begin() be "iterator", not "const iterator".
That may be a good enough argument, although I don't see any advantages to
"iterator" over "const iterator".
Glen