From: Peter Dimov (pdimov_at_[hidden])
Date: 2001-07-24 07:54:33
From: "John Maddock" <John_Maddock_at_[hidden]>
> Not easily, BTW since iostream's are buffered already, its a pity that
> mechanism couldn't be hooked into somehow, but I guess that would mean
> writing your own stream buffer (not nice). I think the best way to "save
> state" as you suggest is to create a smart iterator that pulls more input
> into the buffer as and when it needs it - should be pretty quick and easy
> to set up as well.
Aha, I see (finally) what you mean. Thank you.
I need some iterator guarantees from regex, though. I can't supply a
bidirectional end iterator that way; the start iterator I can even make
random-access as it will pull input where necessary and buffer it, but
should the library call std::distance(first, last) or manipulate 'last' in
any way short of comparing it to 'first' I'm in trouble.
This is yet another kind of iterator (pair) that the standard iterator
categories don't cover. :-) (It's conceptually a [first, +inf) range.)
-- Peter Dimov Multi Media Ltd.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk