(cross-posting to spirit-devel) On 11/8/2010 12:36 PM, Alex Dubov wrote:
Nat Linden
writes: Once upon a time, the Serialization library came with backtracking input iterators used to parse XML input files with Spirit. I briefly glanced over more recent Serialization documentation without spotting them. Do they still exist?
Yes, in a way. Spirit only requires forward iterators, not bidi ones, like xpressive. Input iterators can be adapted to become forward ones in a fairly straightforward way, and indeed, spirit has a customizable multi_pass iterator adapter to do just that.
Up until now I thought spirit to be an overkill for my stuff, but I'm considering using it now.
Just hazarding a guess here, but the multi_pass_iterator probably works by caching all the read data so far. Otherwise, how would it support making a copy of the begin iterator and dereferencing it at a later point in time? If that solution wasn't good enough for you before, you probably don't want multi_pass_iterator+Spirit. Can the Spirit guys chime in on this? -- Eric Niebler BoostPro Computing http://www.boostpro.com