
6 Mar
2008
6 Mar
'08
10:53 p.m.
Eric Niebler wrote:
Phil Endecott wrote:
if I wanted to make the 10+20 subexpression a proto expression, I'd need to somehow taint or cast 10. How would I do that?
proto::as_expr() is useful for this. Guess I should say that in the docs, somewhere.
I neglected to mention that if you're building a DSEL and you wish "as_expr" were called something else, you can do this: proto::functional::as_expr<> const constant = {}; int main() { constant(10) + 20; return 0; } All of Proto's free functions have function object equivalents in the proto::functional namespace. -- Eric Niebler Boost Consulting www.boost-consulting.com