Re: [boost] [Proto] Access to member in proto expression tree

Hi Eric Thanks for all the help so far. I'm now filling out my prototype if/else implementation, mainly following your excellent recipe, and I've encountered a little annoyance. If I write an expression like: _1 + _2 ADL finds all the necessary operators etc in boost::proto (_1 and _2 are my placeholders in the phoenix namespace, using your extends mechanism), so it can built the right expression tree. All good so far. If I now write: if_(_1 == _2)[stuff...] // stuff... is unimportant Unfortunately proto::if_ is pulled in. This means I have to qualify phoenix::if_, which looks a bit too verbose for a lambda library. I think this could be addressed by moving the stuff that does not pertain to expression tree generation out of the boost::proto namespace, and into another boost::proto::other_stuff namespace, so the chances of it being pulled during tree construction are reduced, and I can have my unqualified syntax back. Is this possible? Or have I missed something on my side that could prevent this happening? Cheers Dan ___________________________________________________________ Yahoo! Answers - Got a question? Someone out there knows the answer. Try it now. http://uk.answers.yahoo.com/

dan marsden wrote:
Hi Eric
Thanks for all the help so far. I'm now filling out my prototype if/else implementation, mainly following your excellent recipe, and I've encountered a little annoyance.
If I write an expression like:
_1 + _2
ADL finds all the necessary operators etc in boost::proto (_1 and _2 are my placeholders in the phoenix namespace, using your extends mechanism), so it can built the right expression tree. All good so far.
Actually, the operators, proto::expr and proto::extends have recently moved into the proto::ops namespace for an ADL reason unrelated to yours. expr and extends are made available in the proto namespace with a using declaration.
If I now write:
if_(_1 == _2)[stuff...] // stuff... is unimportant
Unfortunately proto::if_ is pulled in. This means I have to qualify phoenix::if_, which looks a bit too verbose for a lambda library. I think this could be addressed by moving the stuff that does not pertain to expression tree generation out of the boost::proto namespace, and into another boost::proto::other_stuff namespace, so the chances of it being pulled during tree construction are reduced, and I can have my unqualified syntax back. Is this possible? Or have I missed something on my side that could prevent this happening?
Oh man. This ADL stuff .... grrrr. OK, I need to shuffle some stuff around. Thanks for the heads up. -- Eric Niebler Boost Consulting www.boost-consulting.com

dan marsden wrote:
If I now write:
if_(_1 == _2)[stuff...] // stuff... is unimportant
Unfortunately proto::if_ is pulled in. This means I have to qualify phoenix::if_, which looks a bit too verbose for a lambda library. I think this could be addressed by moving the stuff that does not pertain to expression tree generation out of the boost::proto namespace, and into another boost::proto::other_stuff namespace, so the chances of it being pulled during tree construction are reduced, and I can have my unqualified syntax back. Is this possible? Or have I missed something on my side that could prevent this happening?
OK, I've added some ADL-blocking namespaces and the appropriate using directives, so hopefully your problem is fixed now. Please let me know. -- Eric Niebler Boost Consulting www.boost-consulting.com
participants (2)
-
dan marsden
-
Eric Niebler