Joel Falcou wrote:
Eric Niebler a écrit :
Oh, you're using make_expr. If the result of exponent(x) is always in the domain of simd_domain
, then you should use that as the domain parameter to make_expr instead of domain_of<T>::type. Ha, right ! Forgot about domain_of. It fixes this indeed.
Cool.
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.
How does it scale with a large number of function object (say > 300) in term of compile time ? Is there any advantage over make_expr ?
Hard to say. The only advice I can give is to try it and see. -- Eric Niebler BoostPro Computing http://www.boostpro.com