Boost logo

Proto :

Subject: Re: [proto] Feature request: control how the built-in operator overloads build expressions
From: Eric Niebler (eric_at_[hidden])
Date: 2012-05-11 14:34:04


On 5/11/2012 8:04 AM, Mathias Gaunard wrote:
> Proto comes with operator overloads that call make_expr if the arguments
> are in a compatible domain and if the grammar is satisfied.
>
> In some cases however, we'd like to build custom trees that don't
> exactly map to what the default operator overloads would do. We suggest
> adding an extension point per-domain to specify how to make_expr but
> only in the context of the provided operator overloads.
>
> The transformation could arguably be done in the generator or in a later
> pass, but we'd prefer doing that early for different reasons:
> - This only affects expressions generated through the built-in operator
> overloads. Other expressions are generated through our custom functions,
> which already do what we want.
> - We'd like to keep the responsibility of the generator of converting a
> naked expression to an expression in our domain (which, in the case of
> NT2, involves computing the size and logical type of the elements).
> - Doing it at a later pass means we have to run the generator on things
> that don't necessarily have the desired form
>
> The alternative is for us to not rely on Proto-defined operator
> overloads and to overload all that stuff ourselves.

This seems quite reasonable. Could you file a feature request on trac so
I don't loose track of it? Thanks.

-- 
Eric Niebler
BoostPro Computing
http://www.boostpro.com

Proto list run by eric at boostpro.com