Subject: Re: [proto] Thoughts on traversing proto expressions and reusing grammar
From: Eric Niebler (eric_at_[hidden])
Date: 2010-10-15 22:10:23
On Thu, Oct 14, 2010 at 10:46 PM, Thomas Heller
> So, one of your points of criticism was that my solution was overly
> I like to throw this ball back at you. I think both solutions are quite
> verbose. I guess verbosity is what it takes to get a solution meeting the
You're right, my solution is verbose, too. The problem is the
open-extensibility requirement. Proto::or_ is concise. The equivalent
proto::switch_ is verbose. There aren't many constructs in C++ that are
openly extensible. Namespaces, overload sets and template specializations.
(Others?) Only template specializations fit the bill, and specializing a
template takes a lot of typing. And if you want the set of transforms to be
also openly extensible and independent of the grammars, that's twice the
boilerplate. Seems unavoidable.
I'm interested in finding some nice wrapper that presents a cleaner
interface. Maybe even macros could help.
Proto list run by eric at boostpro.com