Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 09:57:05

0001 
0002 #ifndef BOOST_MPL_AUX_LAMBDA_SUPPORT_HPP_INCLUDED
0003 #define BOOST_MPL_AUX_LAMBDA_SUPPORT_HPP_INCLUDED
0004 
0005 // Copyright Aleksey Gurtovoy 2001-2004
0006 //
0007 // Distributed under the Boost Software License, Version 1.0. 
0008 // (See accompanying file LICENSE_1_0.txt or copy at 
0009 // http://www.boost.org/LICENSE_1_0.txt)
0010 //
0011 // See http://www.boost.org/libs/mpl for documentation.
0012 
0013 // $Id$
0014 // $Date$
0015 // $Revision$
0016 
0017 #include <boost/mpl/aux_/config/lambda.hpp>
0018 
0019 #if !defined(BOOST_MPL_CFG_NO_FULL_LAMBDA_SUPPORT)
0020 
0021 #   define BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(i, name, params) /**/
0022 #   define BOOST_MPL_AUX_LAMBDA_SUPPORT(i,name,params) /**/
0023 
0024 #else
0025 
0026 #   include <boost/mpl/int_fwd.hpp>
0027 #   include <boost/mpl/aux_/yes_no.hpp>
0028 #   include <boost/mpl/aux_/na_fwd.hpp>
0029 #   include <boost/mpl/aux_/preprocessor/params.hpp>
0030 #   include <boost/mpl/aux_/preprocessor/enum.hpp>
0031 #   include <boost/mpl/aux_/config/msvc.hpp>
0032 #   include <boost/mpl/aux_/config/workaround.hpp>
0033 
0034 #   include <boost/preprocessor/tuple/to_list.hpp>
0035 #   include <boost/preprocessor/list/for_each_i.hpp>
0036 #   include <boost/preprocessor/inc.hpp>
0037 #   include <boost/preprocessor/cat.hpp>
0038 
0039 #   define BOOST_MPL_AUX_LAMBDA_SUPPORT_ARG_TYPEDEF_FUNC(R,typedef_,i,param) \
0040     typedef_ param BOOST_PP_CAT(arg,BOOST_PP_INC(i)); \
0041     /**/
0042 
0043 // agurt, 07/mar/03: restore an old revision for the sake of SGI MIPSpro C++
0044 #if BOOST_WORKAROUND(__EDG_VERSION__, <= 238) 
0045 
0046 #   define BOOST_MPL_AUX_LAMBDA_SUPPORT(i, name, params) \
0047     typedef BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE::int_<i> arity; \
0048     BOOST_PP_LIST_FOR_EACH_I_R( \
0049           1 \
0050         , BOOST_MPL_AUX_LAMBDA_SUPPORT_ARG_TYPEDEF_FUNC \
0051         , typedef \
0052         , BOOST_PP_TUPLE_TO_LIST(i,params) \
0053         ) \
0054     struct rebind \
0055     { \
0056         template< BOOST_MPL_PP_PARAMS(i,typename U) > struct apply \
0057             : name< BOOST_MPL_PP_PARAMS(i,U) > \
0058         { \
0059         }; \
0060     }; \
0061     /**/
0062 
0063 #   define BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(i, name, params) \
0064     BOOST_MPL_AUX_LAMBDA_SUPPORT(i, name, params) \
0065     /**/
0066 
0067 #elif BOOST_WORKAROUND(__EDG_VERSION__, <= 244) && !defined(BOOST_INTEL_CXX_VERSION)
0068 // agurt, 18/jan/03: old EDG-based compilers actually enforce 11.4 para 9
0069 // (in strict mode), so we have to provide an alternative to the 
0070 // MSVC-optimized implementation
0071 
0072 #   define BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(i, name, params) \
0073     typedef BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE::int_<i> arity; \
0074     BOOST_PP_LIST_FOR_EACH_I_R( \
0075           1 \
0076         , BOOST_MPL_AUX_LAMBDA_SUPPORT_ARG_TYPEDEF_FUNC \
0077         , typedef \
0078         , BOOST_PP_TUPLE_TO_LIST(i,params) \
0079         ) \
0080     struct rebind; \
0081 /**/
0082 
0083 #   define BOOST_MPL_AUX_LAMBDA_SUPPORT(i, name, params) \
0084     BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(i, name, params) \
0085 }; \
0086 template< BOOST_MPL_PP_PARAMS(i,typename T) > \
0087 struct name<BOOST_MPL_PP_PARAMS(i,T)>::rebind \
0088 { \
0089     template< BOOST_MPL_PP_PARAMS(i,typename U) > struct apply \
0090         : name< BOOST_MPL_PP_PARAMS(i,U) > \
0091     { \
0092     }; \
0093 /**/
0094 
0095 #else // __EDG_VERSION__
0096 
0097 namespace boost { namespace mpl { namespace aux {
0098 template< typename T > struct has_rebind_tag;
0099 }}}
0100 
0101 #   define BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(i, name, params) \
0102     typedef BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE::int_<i> arity; \
0103     BOOST_PP_LIST_FOR_EACH_I_R( \
0104           1 \
0105         , BOOST_MPL_AUX_LAMBDA_SUPPORT_ARG_TYPEDEF_FUNC \
0106         , typedef \
0107         , BOOST_PP_TUPLE_TO_LIST(i,params) \
0108         ) \
0109     friend class BOOST_PP_CAT(name,_rebind); \
0110     typedef BOOST_PP_CAT(name,_rebind) rebind; \
0111 /**/
0112 
0113 #if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x610))
0114 #   define BOOST_MPL_AUX_LAMBDA_SUPPORT_HAS_REBIND(i, name, params) \
0115 template< BOOST_MPL_PP_PARAMS(i,typename T) > \
0116 ::boost::mpl::aux::yes_tag operator|( \
0117       ::boost::mpl::aux::has_rebind_tag<int> \
0118     , name<BOOST_MPL_PP_PARAMS(i,T)>* \
0119     ); \
0120 ::boost::mpl::aux::no_tag operator|( \
0121       ::boost::mpl::aux::has_rebind_tag<int> \
0122     , name< BOOST_MPL_PP_ENUM(i,::boost::mpl::na) >* \
0123     ); \
0124 /**/
0125 #elif !BOOST_WORKAROUND(BOOST_MSVC, < 1300)
0126 #   define BOOST_MPL_AUX_LAMBDA_SUPPORT_HAS_REBIND(i, name, params) \
0127 template< BOOST_MPL_PP_PARAMS(i,typename T) > \
0128 ::boost::mpl::aux::yes_tag operator|( \
0129       ::boost::mpl::aux::has_rebind_tag<int> \
0130     , ::boost::mpl::aux::has_rebind_tag< name<BOOST_MPL_PP_PARAMS(i,T)> >* \
0131     ); \
0132 /**/
0133 #else
0134 #   define BOOST_MPL_AUX_LAMBDA_SUPPORT_HAS_REBIND(i, name, params) /**/
0135 #endif
0136 
0137 #   if !defined(BOOST_BORLANDC)
0138 #   define BOOST_MPL_AUX_LAMBDA_SUPPORT(i, name, params) \
0139     BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(i, name, params) \
0140 }; \
0141 BOOST_MPL_AUX_LAMBDA_SUPPORT_HAS_REBIND(i, name, params) \
0142 class BOOST_PP_CAT(name,_rebind) \
0143 { \
0144  public: \
0145     template< BOOST_MPL_PP_PARAMS(i,typename U) > struct apply \
0146         : name< BOOST_MPL_PP_PARAMS(i,U) > \
0147     { \
0148     }; \
0149 /**/
0150 #   else
0151 #   define BOOST_MPL_AUX_LAMBDA_SUPPORT(i, name, params) \
0152     BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(i, name, params) \
0153 }; \
0154 BOOST_MPL_AUX_LAMBDA_SUPPORT_HAS_REBIND(i, name, params) \
0155 class BOOST_PP_CAT(name,_rebind) \
0156 { \
0157  public: \
0158     template< BOOST_MPL_PP_PARAMS(i,typename U) > struct apply \
0159     { \
0160         typedef typename name< BOOST_MPL_PP_PARAMS(i,U) >::type type; \
0161     }; \
0162 /**/
0163 #   endif // BOOST_BORLANDC
0164 
0165 #endif // __EDG_VERSION__
0166 
0167 #endif // BOOST_MPL_CFG_NO_FULL_LAMBDA_SUPPORT
0168 
0169 #endif // BOOST_MPL_AUX_LAMBDA_SUPPORT_HPP_INCLUDED