Boost logo

Boost :

Subject: Re: [boost] [boost/spirit] numeric policy
From: Agustín K-ballo Bergé (kaballo86_at_[hidden])
Date: 2013-08-01 01:03:50

On 31/07/2013 01:37 p.m., Brian Schrom wrote:
> I've had the case where I needed to retain formatting information for a
> number (general, fixed, scientific) and was nicely accomplished by
> extending the policy, but needed to have a begin_parse() and end_parse()
> for the policy to be complete. It seems that it makes some sense or is
> this accomplished another way? Maybe something to consider for policies
> in general?

I am currently reviewing the policies design for Spirit X3, and I'm
tempted to add a `parse` entry-point that drives the entire parsing
operation. I have found that sometimes you need this, as otherwise one
has to jump through hoops in a not so clean way. In this scenario, the
parsing operation could be wrapped in pre/post calls and then forward to
the default implementation.

For Spirit V2, policies are not required to inherit from the default
ones, so any change to them is potentially a breaking change. Although I
have yet to see a case where this would happen.

If you think this approach would work for your use case and you want to
try and make the necessary source and documentation changes, I will be
happy to help you through the process.


Agustín K-ballo Bergé.-

Boost list run by bdawes at, gregod at, cpdaniel at, john at