|
Boost : |
From: Gary Powell (Gary.Powell_at_[hidden])
Date: 2001-05-31 16:00:37
>>
I was trying to avoid virtual function at all costs. If only there
was a way in C++ to get the type of the rhs and pass it into
the lhs, I wouldn't have needed rules. In fact you can do away
with rules if you want to do more typing. Example:
Alternative<ChLit<>, Sequence<ChLit<>, ChLit<> > > rule = a | b >> c;
Assuming a, b and c are ChLits. It's the typing (pun intentional)
that necessitated Rules.
There was a proposal in comp.std.c++ to reuse the auto
keyword to do this. With this extension, we could do:
auto rule = a | b >> c;
And Spririt will completely be static.
Does anyone have a better way of doing this?
<<
Have you looked at http://lambda.cs.utu.fi ? it does some interesting things
holding the type open using expression templates. (Note: I'm only lurking on
the Sprit<> discussion and haven't actually looked at your code.)
Yours,
-gary-
gary.powell_at_[hidden]
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk