
1 Feb
2013
1 Feb
'13
3:31 p.m.
Hi all! I was wondering why the dereference operator of counting_iterator<T> returns a constant reference to T instead of a reference to T. Naively I would expect counting_iterator<T>::reference to be T& and counting_iterator<const T>::reference to be const T&. I suppose however that there was good reason to implement counting_iterator the way it is implemented. Could anyone kindly point this reason out to me? Regards Claas