Boost logo

Boost Users :

Subject: Re: [Boost-users] [Proto] Reducing domain check in operator
From: Eric Niebler (eric_at_[hidden])
Date: 2009-02-26 13:48:42


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<uint_t>, 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

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