
My first reaction is, it doesn't look like the copy constructor will do the right thing (or is it okay to do _reader->clean_up() multiple times?).
clean_up is format specific and so it could call a 3rd party library function. Better not to allow multiple calls.
So, operator* effectively advances the iterator, while operator++...doesn't? Huh? (Do I have that transcribed correctly?)
I fixed that already operator++ is now solely advancing the internal counter.
What I *think* you want is for operator++ to conditionally call _reader->skip (if the previous operator++ had not been followed by a operator*), while operator* should conditionally call _reader->read (depending on if there had been an intervening operator++ after the previous operator*). So, I think you'd need 2 boolean flags.
I need to sleep over this. Skipping and reading are both format specific ( jpeg for instance still reads when skipping ) and so I need to know when to read and when to skip. Just increasing the counter doesn't do it. So, you might be right with suggesting that two boolean flags are needed. Thanks a lot for your insight! Christian