Opened 10 years ago

Last modified 10 years ago

#6891 assigned Feature Requests

Add extension point to define how expressions are created from operators

Reported by: Mathias Gaunard Owned by: Eric Niebler
Milestone: To Be Determined Component: proto
Version: Boost Development Trunk Severity: Problem
Keywords: Cc:

Description

As discussed here: <http://lists.boost.org/proto/2012/05/0637.php>

It would be nice to add a mechanism to allow to define what the operator overloads created by Proto will do. Unlike other functions where a Proto-based library can construct nodes the way it wishes, there is no control and what the built-in C++ operators do.

Change History (3)

comment:1 by Eric Niebler, 10 years ago

Status: newassigned

I'm keeping this feature request in mind while designing proto-11. In the current design, users will be have a per-domain make_expr customization point. I foresee all of proto's operator overloads going through this customization point. So, if for your domain, your make_expr turns tag::foo into my_tag<tag::foo> (for instance), that would just work.

Does this address your scenario?

comment:2 by Mathias Gaunard, 10 years ago

Hmm not quite what I needed. I only wanted the proto-provided operator overloads to call a customization point, not all calls to make_expr.

But if we're talking about a complete redesign where generators disappear, I don't know how it is going to fit in the grander scheme of things.

comment:3 by Eric Niebler, 10 years ago

I would object to a customization point that is only used by the operator overloads. I would like the behavior of the operator overloads to be easily explainable. Having it correspond to the behavior of make_expr feels right to me.

Note: See TracTickets for help on using tickets.