Opened 12 years ago

Last modified 12 years ago

#4668 assigned Tasks

Conditions for operator overload in Proto (documentation)

Reported by: Roland Bock <rbock@…> Owned by: Eric Niebler
Milestone: To Be Determined Component: proto
Version: Boost 1.44.0 Severity: Optimization
Keywords: grammar, domain, extension, operator overload Cc:

Description

Taken from this thread in boost-users: http://lists.boost.org/boost-users/2010/09/62747.php

This explanation by Thomas Heller would make a good section for the proto documentation:

In order for a proto overload to be created the following conditions must be 
true:

1) the operands must be in a compatible domain
2) the left hand operand and the right hand operand must match the grammar 
specified in the domain
3) the resulting expression must match the grammar specified in the domain.

To illustrate what this means, this minimalistic example might be useful, too:

This grammar

proto::plus<proto::terminal<int>, proto::terminal<int> >

used in a domain would not allow

i + i;

with i being an int-terminal.

Change History (1)

comment:1 by Eric Niebler, 12 years ago

Status: newassigned
Note: See TracTickets for help on using tickets.