Boost logo

Boost Users :

Subject: Re: [Boost-users] [xpressive] Using it with input iterators or how far the backtracing will go back
From: Eric Niebler (eric_at_[hidden])
Date: 2010-11-08 14:03:19


(cross-posting to spirit-devel)

On 11/8/2010 12:36 PM, Alex Dubov wrote:
> Nat Linden <nat <at> lindenlab.com> 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

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net