Avoid vc6 confusion from metafunction forwarding

[SVN r20476]
This commit is contained in:
Dave Abrahams
2003-10-24 17:09:08 +00:00
parent f9784f1e19
commit dafe4fae8b
4 changed files with 30 additions and 27 deletions

View File

@@ -197,10 +197,12 @@ template<
typename F, AUX_APPLY_N_PARAMS(i, typename T) typename F, AUX_APPLY_N_PARAMS(i, typename T)
> >
struct BOOST_PP_CAT(apply,i) struct BOOST_PP_CAT(apply,i)
: BOOST_PP_CAT(aux::msvc_apply,i)<F>::template result_<
AUX_APPLY_N_PARAMS(i, T)
>
{ {
// Metafunction forwarding confuses vc6
typedef typename BOOST_PP_CAT(aux::msvc_apply,i)<F>::template result_<
AUX_APPLY_N_PARAMS(i, T)
>::type type;
BOOST_MPL_AUX_LAMBDA_SUPPORT( BOOST_MPL_AUX_LAMBDA_SUPPORT(
BOOST_PP_INC(i) BOOST_PP_INC(i)
, BOOST_PP_CAT(apply,i) , BOOST_PP_CAT(apply,i)

View File

@@ -82,15 +82,16 @@ template<
, bool Protect = true , bool Protect = true
> >
struct lambda struct lambda
: aux::lambda_impl< {
// Metafunction forwarding confuses vc6
typedef typename aux::lambda_impl<
::boost::mpl::aux::template_arity<T>::value ::boost::mpl::aux::template_arity<T>::value
#if !defined(BOOST_MSVC) || BOOST_MSVC > 1200 #if !defined(BOOST_MSVC) || BOOST_MSVC > 1200
, Protect , Protect
#else #else
, bool_<Protect>::value , bool_<Protect>::value
#endif #endif
>::template result_<T,Tag> >::template result_<T,Tag>::type type;
{
}; };
# undef AUX_LAMBDA_PARAMS # undef AUX_LAMBDA_PARAMS

View File

@@ -48,10 +48,11 @@ template<
typename F, typename T1 typename F, typename T1
> >
struct apply1 struct apply1
: aux::msvc_apply1<F>::template result_<
T1
>
{ {
typedef typename aux::msvc_apply1<F>::template result_<
T1
>::type type;
enum { arity = 2 }; typedef F arg1; enum { arity = 2 }; typedef F arg1;
typedef T1 arg2; typedef T1 arg2;
friend class apply1_rebind; friend class apply1_rebind;
@@ -94,10 +95,11 @@ template<
typename F, typename T1, typename T2 typename F, typename T1, typename T2
> >
struct apply2 struct apply2
: aux::msvc_apply2<F>::template result_<
T1, T2
>
{ {
typedef typename aux::msvc_apply2<F>::template result_<
T1, T2
>::type type;
enum { arity = 3 }; typedef F arg1; enum { arity = 3 }; typedef F arg1;
typedef T1 arg2; typedef T1 arg2;
typedef T2 arg3; typedef T2 arg3;
@@ -141,10 +143,10 @@ template<
typename F, typename T1, typename T2, typename T3 typename F, typename T1, typename T2, typename T3
> >
struct apply3 struct apply3
: aux::msvc_apply3<F>::template result_<
T1, T2, T3
>
{ {
typedef typename aux::msvc_apply3<F>::template result_<
T1, T2, T3
>::type type;
enum { arity = 4 }; typedef F arg1; enum { arity = 4 }; typedef F arg1;
typedef T1 arg2; typedef T1 arg2;
typedef T2 arg3; typedef T2 arg3;
@@ -195,10 +197,10 @@ template<
typename F, typename T1, typename T2, typename T3, typename T4 typename F, typename T1, typename T2, typename T3, typename T4
> >
struct apply4 struct apply4
: aux::msvc_apply4<F>::template result_<
T1, T2, T3, T4
>
{ {
typedef typename aux::msvc_apply4<F>::template result_<
T1, T2, T3, T4
>::type type;
enum { arity = 5 }; typedef F arg1; enum { arity = 5 }; typedef F arg1;
typedef T1 arg2; typedef T1 arg2;
typedef T2 arg3; typedef T2 arg3;
@@ -253,10 +255,10 @@ template<
, typename T5 , typename T5
> >
struct apply5 struct apply5
: aux::msvc_apply5<F>::template result_<
T1, T2, T3, T4, T5
>
{ {
typedef typename aux::msvc_apply5<F>::template result_<
T1, T2, T3, T4, T5
>::type type;
enum { arity = 6 }; typedef F arg1; enum { arity = 6 }; typedef F arg1;
typedef T1 arg2; typedef T1 arg2;
typedef T2 arg3; typedef T2 arg3;

View File

@@ -188,13 +188,11 @@ template<
, bool Protect = true , bool Protect = true
> >
struct lambda struct lambda
: aux::lambda_impl<
::boost::mpl::aux::template_arity<T>::value
, bool_<Protect>::value
>::template result_< T,Tag >
{ {
typedef aux::lambda_impl<
::boost::mpl::aux::template_arity<T>::value
, bool_<Protect>::value
>::template result_< T,Tag >::type type;
}; };
} // namespace mpl } // namespace mpl