Joel Falcou wrote:
Eric Niebler a écrit :
Cool.
Small variation. If I want the domain of A(B) always be X, I just specify it with make_expr ?
Yes, or else make A a Proto terminal in the X domain.
Concerning the other approach, I guess it boils down to have terminal of the given function object laying around?
terminal< exponent_ > exponent ={{}}; ----------------------^ ::type here
Right, although it would change the resulting tree, because exponent(x) would have tag type proto::tag::function instead of nt2::tag::exponent_. You'd have to make corresponding changes to your grammar.
To be abel to be called and produce reuslts, exponent_ just need to be a Polymorphic Function Object I assume ?
Yes.
Hard to say. The only advice I can give is to try it and see.
Seems I found my occupation for this week-end then. My main concern is that having lots of declared but unused const object may force the compiler to compile all fo them aka ending in a verrrrrrry long compile-time and prolly large executable too.
You might be right. I'll be interested in your results. -- Eric Niebler BoostPro Computing http://www.boostpro.com