
20 May
2007
20 May
'07
8:37 p.m.
Maurizio Vitale wrote:
Eric Niebler <eric@boost-consulting.com> writes:
Right. I should have suggested that in the first place. I tend to think this approach (declaring an empty terminal and using its operator()()) is nicer because it reuses more of proto's machinery, but the two approaches are equivalent.
There are cases where this approach doesn't work, however. For example, in xpressive, there is a repeat<>() function, for repeating sub-expressions. For instance:
repeat<3,6>('a')
But even there you could have had repeat< > return a proto::terminal and then let the generic overloading of operator()() take care of the rest.
Are you sure about that? :-) -- Eric Niebler Boost Consulting www.boost-consulting.com