From: Gunter Winkler (guwi17_at_[hidden])
Date: 2007-12-10 17:05:21
Am Montag, 10. Dezember 2007 15:52 schrieb Neal Becker:
> I expect this to print 10 '0'. Instead, it prints nothing.
Thats exactly want we want. The (usual) const_iterator exploits the
structure of the underlying data an skips zeros if possible. Thus the
const_iterator of zero_vector is actually a sparse iterator.
The indexed_iterator mentioned in other replies, however, does not skip
any zeros because it does not know the underlying structure. It simply
counts from 0 to size and uses operator(int) to access the data.