
Hi Phil,
I don't follow; what two functionalities?
1) read scanline 2) skip scanline
I imagine your line-by-line reading iterator would look something like (PSEUDO-CODE!!!):
class line_by_line_iterator { buffer_t& buffer;
public: const buffer_t& operator*() const { return buffer; } void operator++() { format_specific_read_one_line_into(buffer); } };
I'd do it using iterator_facade.
A case that this fails to manage efficiently is when your format-specific implementation has an efficient way to skip forward without actually decoding. This is not something that I've ever had to worry about, but I think you could do it easily enough by adding a flag and doing the read lazily in operator*.
you mean pass a boolean into operator*? Thanks, Christian