Boost logo

Boost Users :

Subject: Re: [Boost-users] [boost-spirit qi] internal copies
From: Ovanes Markarian (om_boost_at_[hidden])
Date: 2010-10-07 12:24:02


Hartmut,

thanks for the answer. I don't use semantic actions and my alternatives are
only used in the case where I omit some tokens, so there should not be any
copies than.

Really great lib! I enjoy using it.

Ovanes.

On Thu, Oct 7, 2010 at 3:29 PM, Hartmut Kaiser <hartmut.kaiser_at_[hidden]>wrote:

> ...
>
> The general idea is for all attributes to be directly used to receive the
> parsed data.
>
> Period.
>
> As you might imagine this is not always true. You have to be aware of a
> couple of pitfalls in order to avoid additional copies inside the parser
> generated from a Spirit.Qi expression.
>
> 1) Don't use semantic actions, these need to instantiate an instance of
> the
> attribute in order to pass it to the function (object) to be called.
> 2) Alternatives currently are known to create a new instance of the
> attribute as well. This is a known issue and we need to come up with a
> better solution.
> 3) Somebody posted examples on the Spirit ML a while ago, demonstrating
> that
> certain constructs cause additional copying, but I'm not able to find that,
> currently. All I remember is that it seemed to be possible to overcome
> those
> problems as well. We just have not have the time to look into this more
> closely yet.
>
> HTH
> Regards Hartmut
> ---------------
> http://boost-spirit.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