Boost logo

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 ? 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.)



Boost list run by bdawes at, gregod at, cpdaniel at, john at