18 Oct
2005
18 Oct
'05
12:24 p.m.
"Mats Eklund"
Hello,
does anybody know whether there is something fundamentally wrong with designing an istream iterator that conforms with the forward, or even random access, iterator concepts?
Nope; there's nothing wrong with it. It can get tricky, though: to meet the forward iterator requirements (operator* must return a true reference), your iterator would have to keep an internal cache of the element being referenced. -- Dave Abrahams Boost Consulting www.boost-consulting.com