diff --git a/include/boost/mpl/aux_/preprocessed/bcc/apply.hpp b/include/boost/mpl/aux_/preprocessed/bcc/apply.hpp index 285ff1a..4bcd50d 100644 --- a/include/boost/mpl/aux_/preprocessed/bcc/apply.hpp +++ b/include/boost/mpl/aux_/preprocessed/bcc/apply.hpp @@ -13,15 +13,13 @@ struct apply; template< typename F > struct apply0 : F { -}; - -template<> -struct apply0< arg<-1> > -{ - template< typename F > struct apply - : F - { - }; + static int const arity = 1; typedef F arg1; + friend class apply0_rebind; + typedef apply0_rebind rebind; + }; + class apply0_rebind { public: template< typename U1 > struct apply { typedef typename apply0::type type; + }; + }; template< @@ -143,20 +141,14 @@ struct apply1 , T1 >::type { -}; - -template<> -struct apply1< arg<-1>,arg<-1> > -{ - template< - typename F, typename T1 - > - struct apply - : F::template apply< - T1 - > - { - }; + static int const arity = 2; typedef F arg1; + typedef T1 arg2; + friend class apply1_rebind; + typedef apply1_rebind rebind; + }; + class apply1_rebind { public: template< typename U1, typename U2 > struct apply { typedef typename apply1< U1,U2 >::type type; + }; + }; template< @@ -260,20 +252,15 @@ struct apply2 , T1, T2 >::type { -}; - -template<> -struct apply2< arg<-1>,arg<-1>,arg<-1> > -{ - template< - typename F, typename T1, typename T2 - > - struct apply - : F::template apply< - T1, T2 - > - { - }; + static int const arity = 3; typedef F arg1; + typedef T1 arg2; + typedef T2 arg3; + friend class apply2_rebind; + typedef apply2_rebind rebind; + }; + class apply2_rebind { public: template< typename U1, typename U2, typename U3 > struct apply { typedef typename apply2< U1,U2,U3 >::type type; + }; + }; template< @@ -358,20 +345,16 @@ struct apply3 , T1, T2, T3 >::type { -}; - -template<> -struct apply3< arg<-1>,arg<-1>,arg<-1>,arg<-1> > -{ - template< - typename F, typename T1, typename T2, typename T3 - > - struct apply - : F::template apply< - T1, T2, T3 - > - { - }; + static int const arity = 4; typedef F arg1; + typedef T1 arg2; + typedef T2 arg3; + typedef T3 arg4; + friend class apply3_rebind; + typedef apply3_rebind rebind; + }; + class apply3_rebind { public: template< typename U1, typename U2, typename U3, typename U4 > struct apply { typedef typename apply3< U1,U2,U3,U4 >::type type; + }; + }; template< @@ -437,20 +420,17 @@ struct apply4 , T1, T2, T3, T4 >::type { -}; - -template<> -struct apply4< arg<-1>,arg<-1>,arg<-1>,arg<-1>,arg<-1> > -{ - template< - typename F, typename T1, typename T2, typename T3, typename T4 - > - struct apply - : F::template apply< - T1, T2, T3, T4 - > - { - }; + static int const arity = 5; typedef F arg1; + typedef T1 arg2; + typedef T2 arg3; + typedef T3 arg4; + typedef T4 arg5; + friend class apply4_rebind; + typedef apply4_rebind rebind; + }; + class apply4_rebind { public: template< typename U1, typename U2, typename U3, typename U4, typename U5 > struct apply { typedef typename apply4< U1,U2,U3,U4,U5 >::type type; + }; + }; template< @@ -500,21 +480,18 @@ struct apply5 , T1, T2, T3, T4, T5 >::type { -}; - -template<> -struct apply5< arg<-1>,arg<-1>,arg<-1>,arg<-1>,arg<-1>,arg<-1> > -{ - template< - typename F, typename T1, typename T2, typename T3, typename T4 - , typename T5 - > - struct apply - : F::template apply< - T1, T2, T3, T4, T5 - > - { - }; + static int const arity = 6; typedef F arg1; + typedef T1 arg2; + typedef T2 arg3; + typedef T3 arg4; + typedef T4 arg5; + typedef T5 arg6; + friend class apply5_rebind; + typedef apply5_rebind rebind; + }; + class apply5_rebind { public: template< typename U1, typename U2, typename U3, typename U4, typename U5, typename U6 > struct apply { typedef typename apply5< U1,U2,U3,U4,U5,U6 >::type type; + }; + }; // primary template (not a specialization!) diff --git a/include/boost/mpl/aux_/preprocessed/bcc551/apply.hpp b/include/boost/mpl/aux_/preprocessed/bcc551/apply.hpp index 285ff1a..4bcd50d 100644 --- a/include/boost/mpl/aux_/preprocessed/bcc551/apply.hpp +++ b/include/boost/mpl/aux_/preprocessed/bcc551/apply.hpp @@ -13,15 +13,13 @@ struct apply; template< typename F > struct apply0 : F { -}; - -template<> -struct apply0< arg<-1> > -{ - template< typename F > struct apply - : F - { - }; + static int const arity = 1; typedef F arg1; + friend class apply0_rebind; + typedef apply0_rebind rebind; + }; + class apply0_rebind { public: template< typename U1 > struct apply { typedef typename apply0::type type; + }; + }; template< @@ -143,20 +141,14 @@ struct apply1 , T1 >::type { -}; - -template<> -struct apply1< arg<-1>,arg<-1> > -{ - template< - typename F, typename T1 - > - struct apply - : F::template apply< - T1 - > - { - }; + static int const arity = 2; typedef F arg1; + typedef T1 arg2; + friend class apply1_rebind; + typedef apply1_rebind rebind; + }; + class apply1_rebind { public: template< typename U1, typename U2 > struct apply { typedef typename apply1< U1,U2 >::type type; + }; + }; template< @@ -260,20 +252,15 @@ struct apply2 , T1, T2 >::type { -}; - -template<> -struct apply2< arg<-1>,arg<-1>,arg<-1> > -{ - template< - typename F, typename T1, typename T2 - > - struct apply - : F::template apply< - T1, T2 - > - { - }; + static int const arity = 3; typedef F arg1; + typedef T1 arg2; + typedef T2 arg3; + friend class apply2_rebind; + typedef apply2_rebind rebind; + }; + class apply2_rebind { public: template< typename U1, typename U2, typename U3 > struct apply { typedef typename apply2< U1,U2,U3 >::type type; + }; + }; template< @@ -358,20 +345,16 @@ struct apply3 , T1, T2, T3 >::type { -}; - -template<> -struct apply3< arg<-1>,arg<-1>,arg<-1>,arg<-1> > -{ - template< - typename F, typename T1, typename T2, typename T3 - > - struct apply - : F::template apply< - T1, T2, T3 - > - { - }; + static int const arity = 4; typedef F arg1; + typedef T1 arg2; + typedef T2 arg3; + typedef T3 arg4; + friend class apply3_rebind; + typedef apply3_rebind rebind; + }; + class apply3_rebind { public: template< typename U1, typename U2, typename U3, typename U4 > struct apply { typedef typename apply3< U1,U2,U3,U4 >::type type; + }; + }; template< @@ -437,20 +420,17 @@ struct apply4 , T1, T2, T3, T4 >::type { -}; - -template<> -struct apply4< arg<-1>,arg<-1>,arg<-1>,arg<-1>,arg<-1> > -{ - template< - typename F, typename T1, typename T2, typename T3, typename T4 - > - struct apply - : F::template apply< - T1, T2, T3, T4 - > - { - }; + static int const arity = 5; typedef F arg1; + typedef T1 arg2; + typedef T2 arg3; + typedef T3 arg4; + typedef T4 arg5; + friend class apply4_rebind; + typedef apply4_rebind rebind; + }; + class apply4_rebind { public: template< typename U1, typename U2, typename U3, typename U4, typename U5 > struct apply { typedef typename apply4< U1,U2,U3,U4,U5 >::type type; + }; + }; template< @@ -500,21 +480,18 @@ struct apply5 , T1, T2, T3, T4, T5 >::type { -}; - -template<> -struct apply5< arg<-1>,arg<-1>,arg<-1>,arg<-1>,arg<-1>,arg<-1> > -{ - template< - typename F, typename T1, typename T2, typename T3, typename T4 - , typename T5 - > - struct apply - : F::template apply< - T1, T2, T3, T4, T5 - > - { - }; + static int const arity = 6; typedef F arg1; + typedef T1 arg2; + typedef T2 arg3; + typedef T3 arg4; + typedef T4 arg5; + typedef T5 arg6; + friend class apply5_rebind; + typedef apply5_rebind rebind; + }; + class apply5_rebind { public: template< typename U1, typename U2, typename U3, typename U4, typename U5, typename U6 > struct apply { typedef typename apply5< U1,U2,U3,U4,U5,U6 >::type type; + }; + }; // primary template (not a specialization!) diff --git a/include/boost/mpl/aux_/preprocessed/msvc60/apply.hpp b/include/boost/mpl/aux_/preprocessed/msvc60/apply.hpp index 5839e57..fa422a8 100644 --- a/include/boost/mpl/aux_/preprocessed/msvc60/apply.hpp +++ b/include/boost/mpl/aux_/preprocessed/msvc60/apply.hpp @@ -7,15 +7,12 @@ namespace mpl { template< typename F > struct apply0 : F { -}; - -template<> -struct apply0< arg<-1> > -{ - template< typename F > struct apply - : F - { - }; + enum { arity = 1 }; typedef F arg1; + friend class apply0_rebind; + typedef apply0_rebind rebind; + }; + class apply0_rebind { public: template< typename U1 > struct apply : apply0 { }; + }; // workaround for the ETI bug @@ -55,6 +52,13 @@ struct apply1 T1 > { + enum { arity = 2 }; typedef F arg1; + typedef T1 arg2; + friend class apply1_rebind; + typedef apply1_rebind rebind; + }; + class apply1_rebind { public: template< typename U1, typename U2 > struct apply : apply1< U1,U2 > { }; + }; // workaround for ETI bug @@ -64,20 +68,6 @@ struct apply1< int,int > typedef int type; }; -template<> -struct apply1< arg<-1>,arg<-1> > -{ - template< - typename F, typename T1 - > - struct apply - : aux::msvc_apply1::template result_< - T1 - > - { - }; -}; - namespace aux { template< typename F> @@ -108,6 +98,14 @@ struct apply2 T1, T2 > { + enum { arity = 3 }; typedef F arg1; + typedef T1 arg2; + typedef T2 arg3; + friend class apply2_rebind; + typedef apply2_rebind rebind; + }; + class apply2_rebind { public: template< typename U1, typename U2, typename U3 > struct apply : apply2< U1,U2,U3 > { }; + }; // workaround for ETI bug @@ -117,20 +115,6 @@ struct apply2< int,int,int > typedef int type; }; -template<> -struct apply2< arg<-1>,arg<-1>,arg<-1> > -{ - template< - typename F, typename T1, typename T2 - > - struct apply - : aux::msvc_apply2::template result_< - T1, T2 - > - { - }; -}; - namespace aux { template< typename F> @@ -161,6 +145,15 @@ struct apply3 T1, T2, T3 > { + enum { arity = 4 }; typedef F arg1; + typedef T1 arg2; + typedef T2 arg3; + typedef T3 arg4; + friend class apply3_rebind; + typedef apply3_rebind rebind; + }; + class apply3_rebind { public: template< typename U1, typename U2, typename U3, typename U4 > struct apply : apply3< U1,U2,U3,U4 > { }; + }; // workaround for ETI bug @@ -170,20 +163,6 @@ struct apply3< int,int,int,int > typedef int type; }; -template<> -struct apply3< arg<-1>,arg<-1>,arg<-1>,arg<-1> > -{ - template< - typename F, typename T1, typename T2, typename T3 - > - struct apply - : aux::msvc_apply3::template result_< - T1, T2, T3 - > - { - }; -}; - namespace aux { template< typename F> @@ -220,6 +199,16 @@ struct apply4 T1, T2, T3, T4 > { + enum { arity = 5 }; typedef F arg1; + typedef T1 arg2; + typedef T2 arg3; + typedef T3 arg4; + typedef T4 arg5; + friend class apply4_rebind; + typedef apply4_rebind rebind; + }; + class apply4_rebind { public: template< typename U1, typename U2, typename U3, typename U4, typename U5 > struct apply : apply4< U1,U2,U3,U4,U5 > { }; + }; // workaround for ETI bug @@ -229,20 +218,6 @@ struct apply4< int,int,int,int,int > typedef int type; }; -template<> -struct apply4< arg<-1>,arg<-1>,arg<-1>,arg<-1>,arg<-1> > -{ - template< - typename F, typename T1, typename T2, typename T3, typename T4 - > - struct apply - : aux::msvc_apply4::template result_< - T1, T2, T3, T4 - > - { - }; -}; - namespace aux { template< typename F> @@ -282,6 +257,17 @@ struct apply5 T1, T2, T3, T4, T5 > { + enum { arity = 6 }; typedef F arg1; + typedef T1 arg2; + typedef T2 arg3; + typedef T3 arg4; + typedef T4 arg5; + typedef T5 arg6; + friend class apply5_rebind; + typedef apply5_rebind rebind; + }; + class apply5_rebind { public: template< typename U1, typename U2, typename U3, typename U4, typename U5, typename U6 > struct apply : apply5< U1,U2,U3,U4,U5,U6 > { }; + }; // workaround for ETI bug @@ -291,21 +277,6 @@ struct apply5< int,int,int,int,int,int > typedef int type; }; -template<> -struct apply5< arg<-1>,arg<-1>,arg<-1>,arg<-1>,arg<-1>,arg<-1> > -{ - template< - typename F, typename T1, typename T2, typename T3, typename T4 - , typename T5 - > - struct apply - : aux::msvc_apply5::template result_< - T1, T2, T3, T4, T5 - > - { - }; -}; - } // namespace mpl } // namespace boost diff --git a/include/boost/mpl/aux_/preprocessed/msvc70/apply.hpp b/include/boost/mpl/aux_/preprocessed/msvc70/apply.hpp index 6450aa1..a65c802 100644 --- a/include/boost/mpl/aux_/preprocessed/msvc70/apply.hpp +++ b/include/boost/mpl/aux_/preprocessed/msvc70/apply.hpp @@ -11,15 +11,12 @@ template< int arity_ > struct apply_impl_chooser; template< typename F > struct apply0 : F { -}; - -template<> -struct apply0< arg<-1> > -{ - template< typename F > struct apply - : F - { - }; + enum { arity = 1 }; typedef F arg1; + friend class apply0_rebind; + typedef apply0_rebind rebind; + }; + class apply0_rebind { public: template< typename U1 > struct apply : apply0 { }; + }; namespace aux { @@ -49,20 +46,13 @@ struct apply1 T1 > { -}; - -template<> -struct apply1< arg<-1>,arg<-1> > -{ - template< - typename F, typename T1 - > - struct apply - : F::template apply< - T1 - > - { - }; + enum { arity = 2 }; typedef F arg1; + typedef T1 arg2; + friend class apply1_rebind; + typedef apply1_rebind rebind; + }; + class apply1_rebind { public: template< typename U1, typename U2 > struct apply : apply1< U1,U2 > { }; + }; namespace aux { @@ -92,20 +82,14 @@ struct apply2 T1, T2 > { -}; - -template<> -struct apply2< arg<-1>,arg<-1>,arg<-1> > -{ - template< - typename F, typename T1, typename T2 - > - struct apply - : F::template apply< - T1, T2 - > - { - }; + enum { arity = 3 }; typedef F arg1; + typedef T1 arg2; + typedef T2 arg3; + friend class apply2_rebind; + typedef apply2_rebind rebind; + }; + class apply2_rebind { public: template< typename U1, typename U2, typename U3 > struct apply : apply2< U1,U2,U3 > { }; + }; namespace aux { @@ -135,20 +119,15 @@ struct apply3 T1, T2, T3 > { -}; - -template<> -struct apply3< arg<-1>,arg<-1>,arg<-1>,arg<-1> > -{ - template< - typename F, typename T1, typename T2, typename T3 - > - struct apply - : F::template apply< - T1, T2, T3 - > - { - }; + enum { arity = 4 }; typedef F arg1; + typedef T1 arg2; + typedef T2 arg3; + typedef T3 arg4; + friend class apply3_rebind; + typedef apply3_rebind rebind; + }; + class apply3_rebind { public: template< typename U1, typename U2, typename U3, typename U4 > struct apply : apply3< U1,U2,U3,U4 > { }; + }; namespace aux { @@ -178,20 +157,16 @@ struct apply4 T1, T2, T3, T4 > { -}; - -template<> -struct apply4< arg<-1>,arg<-1>,arg<-1>,arg<-1>,arg<-1> > -{ - template< - typename F, typename T1, typename T2, typename T3, typename T4 - > - struct apply - : F::template apply< - T1, T2, T3, T4 - > - { - }; + enum { arity = 5 }; typedef F arg1; + typedef T1 arg2; + typedef T2 arg3; + typedef T3 arg4; + typedef T4 arg5; + friend class apply4_rebind; + typedef apply4_rebind rebind; + }; + class apply4_rebind { public: template< typename U1, typename U2, typename U3, typename U4, typename U5 > struct apply : apply4< U1,U2,U3,U4,U5 > { }; + }; namespace aux { @@ -222,21 +197,17 @@ struct apply5 T1, T2, T3, T4, T5 > { -}; - -template<> -struct apply5< arg<-1>,arg<-1>,arg<-1>,arg<-1>,arg<-1>,arg<-1> > -{ - template< - typename F, typename T1, typename T2, typename T3, typename T4 - , typename T5 - > - struct apply - : F::template apply< - T1, T2, T3, T4, T5 - > - { - }; + enum { arity = 6 }; typedef F arg1; + typedef T1 arg2; + typedef T2 arg3; + typedef T3 arg4; + typedef T4 arg5; + typedef T5 arg6; + friend class apply5_rebind; + typedef apply5_rebind rebind; + }; + class apply5_rebind { public: template< typename U1, typename U2, typename U3, typename U4, typename U5, typename U6 > struct apply : apply5< U1,U2,U3,U4,U5,U6 > { }; + }; namespace aux { diff --git a/include/boost/mpl/aux_/preprocessed/no_ctps/apply.hpp b/include/boost/mpl/aux_/preprocessed/no_ctps/apply.hpp index e5f87c4..12f7018 100644 --- a/include/boost/mpl/aux_/preprocessed/no_ctps/apply.hpp +++ b/include/boost/mpl/aux_/preprocessed/no_ctps/apply.hpp @@ -11,15 +11,12 @@ template< int arity_ > struct apply_impl_chooser; template< typename F > struct apply0 : F { -}; - -template<> -struct apply0< arg<-1> > -{ - template< typename F > struct apply - : F - { - }; + static int const arity = 1; typedef F arg1; + friend class apply0_rebind; + typedef apply0_rebind rebind; + }; + class apply0_rebind { public: template< typename U1 > struct apply : apply0 { }; + }; namespace aux { @@ -49,20 +46,13 @@ struct apply1 T1 > { -}; - -template<> -struct apply1< arg<-1>,arg<-1> > -{ - template< - typename F, typename T1 - > - struct apply - : F::template apply< - T1 - > - { - }; + static int const arity = 2; typedef F arg1; + typedef T1 arg2; + friend class apply1_rebind; + typedef apply1_rebind rebind; + }; + class apply1_rebind { public: template< typename U1, typename U2 > struct apply : apply1< U1,U2 > { }; + }; namespace aux { @@ -92,20 +82,14 @@ struct apply2 T1, T2 > { -}; - -template<> -struct apply2< arg<-1>,arg<-1>,arg<-1> > -{ - template< - typename F, typename T1, typename T2 - > - struct apply - : F::template apply< - T1, T2 - > - { - }; + static int const arity = 3; typedef F arg1; + typedef T1 arg2; + typedef T2 arg3; + friend class apply2_rebind; + typedef apply2_rebind rebind; + }; + class apply2_rebind { public: template< typename U1, typename U2, typename U3 > struct apply : apply2< U1,U2,U3 > { }; + }; namespace aux { @@ -135,20 +119,15 @@ struct apply3 T1, T2, T3 > { -}; - -template<> -struct apply3< arg<-1>,arg<-1>,arg<-1>,arg<-1> > -{ - template< - typename F, typename T1, typename T2, typename T3 - > - struct apply - : F::template apply< - T1, T2, T3 - > - { - }; + static int const arity = 4; typedef F arg1; + typedef T1 arg2; + typedef T2 arg3; + typedef T3 arg4; + friend class apply3_rebind; + typedef apply3_rebind rebind; + }; + class apply3_rebind { public: template< typename U1, typename U2, typename U3, typename U4 > struct apply : apply3< U1,U2,U3,U4 > { }; + }; namespace aux { @@ -178,20 +157,16 @@ struct apply4 T1, T2, T3, T4 > { -}; - -template<> -struct apply4< arg<-1>,arg<-1>,arg<-1>,arg<-1>,arg<-1> > -{ - template< - typename F, typename T1, typename T2, typename T3, typename T4 - > - struct apply - : F::template apply< - T1, T2, T3, T4 - > - { - }; + static int const arity = 5; typedef F arg1; + typedef T1 arg2; + typedef T2 arg3; + typedef T3 arg4; + typedef T4 arg5; + friend class apply4_rebind; + typedef apply4_rebind rebind; + }; + class apply4_rebind { public: template< typename U1, typename U2, typename U3, typename U4, typename U5 > struct apply : apply4< U1,U2,U3,U4,U5 > { }; + }; namespace aux { @@ -222,21 +197,17 @@ struct apply5 T1, T2, T3, T4, T5 > { -}; - -template<> -struct apply5< arg<-1>,arg<-1>,arg<-1>,arg<-1>,arg<-1>,arg<-1> > -{ - template< - typename F, typename T1, typename T2, typename T3, typename T4 - , typename T5 - > - struct apply - : F::template apply< - T1, T2, T3, T4, T5 - > - { - }; + static int const arity = 6; typedef F arg1; + typedef T1 arg2; + typedef T2 arg3; + typedef T3 arg4; + typedef T4 arg5; + typedef T5 arg6; + friend class apply5_rebind; + typedef apply5_rebind rebind; + }; + class apply5_rebind { public: template< typename U1, typename U2, typename U3, typename U4, typename U5, typename U6 > struct apply : apply5< U1,U2,U3,U4,U5,U6 > { }; + }; namespace aux {