
16 Feb
2007
16 Feb
'07
9:55 p.m.
Frank Mori Hess wrote:
To be clear, what I'm saying is something like the following:
operator()(Iterator begin, Iterator end) { *begin; // slot executes; *begin; // slot does not execute; Iterator next = begin; ++next; *begin; // slot executes again }
What I meant is that with "++next" you pass the position referred to by "begin" and with "*begin" you reuse that position, which I interpret as a second pass. I don't know what the standard exactly says and I don't have a copy here, but I'm quite sure the same wouldn't work with a lot of input iterators that are widely used. You at least couldn't rely on getting the value you expect with an istream_iterator, for example. Regards Timmo Stange