|
Boost : |
From: Eric Niebler (eric_at_[hidden])
Date: 2007-07-02 18:09:55
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
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk