Boost logo

Proto :

Subject: Re: [proto] Grouping expressions
From: Bart Janssens (bart.janssens_at_[hidden])
Date: 2011-12-30 11:34:51

On Fri, Dec 30, 2011 at 7:01 AM, Eric Niebler <eric_at_[hidden]> wrote:
> Are you certain your problem is caused by using operator() for grouping?
> I think this is just a very big expression template, and any syntax you
> choose for grouping will result in long compile times and heavy memory
> usage.

Yes, that's what I mean, the way grouping works now always creates a
huge expression.

> Can I ask, what version of Boost are you using? I see you #define
> BOOST_PROTO_MAX_ARITY to 10 at the top. In recent versions of Proto, 10
> is the default. And newer Proto versions already make use of variadic
> templates for operator() if available.

I'm using 1.46.1 for now. Good to hear variadic templates are already
available for this, do I need to do anything explicit to enable them,
such as add a compile option?

> Other things to think about: does this really need to be all one big
> expression, or can parts of it be broken up and type-erased, as with
> spirit::qi::rule?

Not sure how this type-erased method works, but all of the expressions
are ran in a tight loop, so I'd like to avoid the overhead of having
to go through a virtual call. Also, I use some introspection across
the whole expression to determine which variables exist.



Proto list run by eric at