From d4cedca95ed134d31d3667a07e4755babc011a19 Mon Sep 17 00:00:00 2001 From: Aleksey Gurtovoy Date: Thu, 18 Sep 2003 07:39:27 +0000 Subject: [PATCH] gcc ADL fix for if_ [SVN r20093] --- include/boost/mpl/if.hpp | 194 ++++++++++++++++++++------------------- 1 file changed, 99 insertions(+), 95 deletions(-) diff --git a/include/boost/mpl/if.hpp b/include/boost/mpl/if.hpp index 65906a7..26b1aff 100644 --- a/include/boost/mpl/if.hpp +++ b/include/boost/mpl/if.hpp @@ -3,7 +3,7 @@ #define BOOST_MPL_IF_HPP_INCLUDED // + file: boost/mpl/if.hpp -// + last modified: 10/mar/03 +// + last modified: 17/sep/03 // Copyright (c) 2000-03 Boost.org // @@ -25,8 +25,8 @@ #include "boost/mpl/aux_/config/workaround.hpp" #include "boost/config.hpp" -#ifndef BOOST_MPL_NO_FULL_LAMBDA_SUPPORT -# include "boost/mpl/arg_fwd.hpp" +#if !defined(BOOST_MPL_NO_FULL_LAMBDA_SUPPORT) +# include "boost/mpl/arg_fwd.hpp" #endif namespace boost { @@ -34,6 +34,8 @@ namespace mpl { #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) +BOOST_MPL_AUX_AGLORITHM_NAMESPACE_BEGIN + template< bool C , typename T1 @@ -78,97 +80,6 @@ struct if_ BOOST_MPL_AUX_LAMBDA_SUPPORT(3,if_,(C,T1,T2)) }; - -#ifndef BOOST_MPL_NO_FULL_LAMBDA_SUPPORT - -// Aleksey, check it out: lazy if_ evaluation in lambdas! -// I think this doesn't handle the case of -// -// _1, bar<_2>, baz<_2> > -// -// (or however it is that you express that... when the ordinary bind3 -// computes the function based on the actual arguments). That leads me -// to think that some kind of true currying might be a better -// approach, e.g.: -// -// -// boost::mpl::bind3< -// boost::mpl::quote3 -// , boost::mpl::bind1, boost::mpl::arg<1> > -// , boost::mpl::arg<1> -// , boost::mpl::bind1, boost::mpl::arg<1> > -// >::apply<...> -// -// becomes: -// -// boost::mpl::bind< -// boost::mpl::quote3 -// >::bind< -// , boost::mpl::bind1, -// boost::mpl::arg<1> > -// >::bind< -// boost::mpl::arg<1> -// >::bind< -// boost::mpl::bind1, boost::mpl::arg<1> > -// >::apply<...> -// -// so that after the 2nd bind we have a different function depending -// on the result of is_reference. - -template struct bind3; -template