Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r67490 - trunk/boost/proto
From: eric_at_[hidden]
Date: 2010-12-29 10:00:21


Author: eric_niebler
Date: 2010-12-29 10:00:20 EST (Wed, 29 Dec 2010)
New Revision: 67490
URL: http://svn.boost.org/trac/boost/changeset/67490

Log:
fix ADL issue with comma operator in and_ transform
Text files modified:
   trunk/boost/proto/matches.hpp | 13 +++++++++----
   1 files changed, 9 insertions(+), 4 deletions(-)

Modified: trunk/boost/proto/matches.hpp
==============================================================================
--- trunk/boost/proto/matches.hpp (original)
+++ trunk/boost/proto/matches.hpp 2010-12-29 10:00:20 EST (Wed, 29 Dec 2010)
@@ -990,6 +990,7 @@
                 BOOST_PP_CAT(Gimpl, N); \
                 /**/
                 BOOST_PP_REPEAT(N, M0, ~)
+ #undef M0
 
                 typedef typename BOOST_PP_CAT(Gimpl, BOOST_PP_DEC(N))::result_type result_type;
 
@@ -999,11 +1000,15 @@
                   , typename _and_impl::data_param d
                 ) const
                 {
- // expands to (G0()(e,s,d),G1()(e,s,d),...);
- return (BOOST_PP_ENUM_BINARY_PARAMS(N, Gimpl, ()(e,s,d) BOOST_PP_INTERCEPT));
+ // Fix: jfalcou - 12/29/2010
+ // Avoid the use of comma operator here so as not to find Proto's
+ // by accident.
+ // expands to G0()(e,s,d); G1()(e,s,d); ... G{N-1}()(e,s,d);
+ #define M0(Z,N,DATA) BOOST_PP_CAT(Gimpl,N)()(e,s,d);
+ BOOST_PP_REPEAT(BOOST_PP_DEC(N),M0,~)
+ return BOOST_PP_CAT(Gimpl,BOOST_PP_DEC(N))()(e,s,d);
+ #undef M0
                 }
-
- #undef M0
             };
 
             template<bool B, typename Expr, typename BasicExpr, BOOST_PP_ENUM_PARAMS(N, typename G)>


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk