On 03/06/2012 09:41, Eric Niebler wrote:
Hey all, this is just an FYI. I've been hard at work at a ground-up
redesign of proto for C++11.
Great news !
1) Rather than writing expression wrappers, you'll be writing actual
expression types. Proto provides helpers that make this easy. To get the
basics, inherit from basic_expr. To get tree-building assign, subscript,
and function call operators, inherit from expr_assign, expr_subscript
and expr_function respectively.
I make a lot of sense actually.
2) Rather than writing generators, you'll be defining per-domain
make_expr function objects that accept a tag and a number of children.
How you decide to assemble these into an expression is up to you, but
you can use a helper like make_custom_expr above to simplify things.
It's very important those make_expr functino object could be extended
externally of any structure. By the look of it, it looks like
it'll behave similary to the switch_ construct, aka a template functor
inside a struct to be extended outside.
3) There are other per-domain customization points: (a) store_value,
which specifies the capture policy for non-proto objects in expressions,
and (b) store_child, which specifies how children are stored. For both
(a) and (b), the default is: lvalues are stored by reference and rvalues
are stored by (moved from) value. Expressions can safely be stored in
auto variables by default.
So I guess it also fix the problem we faced with Mathias on having to
store everythign by value to have proper chains of expression building
function works properly ?
Thanks all for now. Feedback welcome. If you have wishlist features for
proto-11, speak now.
On eo fmy PHD student will start converting Quaff to C++11 this july, so
depending on your advancement on Proot-11, we may give it a shot an
dreport any missing features.
proto mailing list