
On 10/25/2006 05:30 AM, Tobias Schwinger wrote: [snip]
Well, the experiment was driven by the question whether it would be possible to add more features of spirit::rule to a macro-based replacement that uses typeof instead of virtual dispatch (see boost/spirit/utility/rule_parser.hpp, note: no named parameters in there, yet) without compromising the interface or even making it better.
The zip file: <boost-vault>/Template Metaprogramming/proto_static_disp.zip uses g++ typeof, CRTP, and mpl::fold to do what sounds like something similar, i.e. eliminate the virtual dispatch. IIRC, the CRTP was needed since the parse functions were mutually recursive and CRTP allowed them to be defined in the same class, or something like that. Maybe viewing your code would give me some ideas about how to tweak proto_static_disp. Any chance you could post it?