Chris@16: Chris@16: // Copyright Peter Dimov 2001 Chris@16: // Copyright Aleksey Gurtovoy 2001-2004 Chris@16: // Chris@16: // Distributed under the Boost Software License, Version 1.0. Chris@16: // (See accompanying file LICENSE_1_0.txt or copy at Chris@16: // http://www.boost.org/LICENSE_1_0.txt) Chris@16: // Chris@16: Chris@16: // Preprocessed version of "boost/mpl/bind.hpp" header Chris@16: // -- DO NOT modify by hand! Chris@16: Chris@16: namespace boost { namespace mpl { Chris@16: Chris@16: namespace aux { Chris@16: template< bool > Chris@16: struct resolve_arg_impl Chris@16: { Chris@16: template< Chris@16: typename T, typename U1, typename U2, typename U3 Chris@16: , typename U4, typename U5 Chris@16: > Chris@16: struct result_ Chris@16: { Chris@16: typedef T type; Chris@16: }; Chris@16: }; Chris@16: Chris@16: template<> Chris@16: struct resolve_arg_impl Chris@16: { Chris@16: template< Chris@16: typename T, typename U1, typename U2, typename U3 Chris@16: , typename U4, typename U5 Chris@16: > Chris@16: struct result_ Chris@16: { Chris@16: typedef typename apply_wrap5< Chris@16: T Chris@16: , U1, U2, U3, U4, U5 Chris@16: >::type type; Chris@16: }; Chris@16: }; Chris@16: Chris@16: template< typename T > struct is_bind_template; Chris@16: Chris@16: template< Chris@16: typename T, typename U1, typename U2, typename U3, typename U4 Chris@16: , typename U5 Chris@16: > Chris@16: struct resolve_bind_arg Chris@16: : resolve_arg_impl< is_bind_template::value > Chris@16: ::template result_< T,U1,U2,U3,U4,U5 > Chris@16: { Chris@16: }; Chris@16: Chris@16: template< typename T > Chris@16: struct replace_unnamed_arg_impl Chris@16: { Chris@16: template< typename Arg > struct result_ Chris@16: { Chris@16: typedef Arg next; Chris@16: typedef T type; Chris@16: }; Chris@16: }; Chris@16: Chris@16: template<> Chris@16: struct replace_unnamed_arg_impl< arg< -1 > > Chris@16: { Chris@16: template< typename Arg > struct result_ Chris@16: { Chris@16: typedef typename next::type next; Chris@16: typedef Arg type; Chris@16: }; Chris@16: }; Chris@16: Chris@16: template< typename T, typename Arg > Chris@16: struct replace_unnamed_arg Chris@16: : replace_unnamed_arg_impl::template result_ Chris@16: { Chris@16: }; Chris@16: Chris@16: template< int arity_ > struct bind_chooser; Chris@16: Chris@16: aux::no_tag is_bind_helper(...); Chris@16: template< typename T > aux::no_tag is_bind_helper(protect*); Chris@16: Chris@16: template< int N > Chris@16: aux::yes_tag is_bind_helper(arg*); Chris@16: Chris@16: template< bool is_ref_ = true > Chris@16: struct is_bind_template_impl Chris@16: { Chris@16: template< typename T > struct result_ Chris@16: { Chris@16: BOOST_STATIC_CONSTANT(bool, value = false); Chris@16: }; Chris@16: }; Chris@16: Chris@16: template<> Chris@16: struct is_bind_template_impl Chris@16: { Chris@16: template< typename T > struct result_ Chris@16: { Chris@16: BOOST_STATIC_CONSTANT(bool, value = Chris@16: sizeof(aux::is_bind_helper(static_cast(0))) Chris@16: == sizeof(aux::yes_tag) Chris@16: ); Chris@16: }; Chris@16: }; Chris@16: Chris@16: template< typename T > struct is_bind_template Chris@16: : is_bind_template_impl< ::boost::detail::is_reference_impl::value > Chris@16: ::template result_ Chris@16: { Chris@16: }; Chris@16: Chris@16: } // namespace aux Chris@16: Chris@16: template< Chris@16: typename F Chris@16: > Chris@16: struct bind0 Chris@16: { Chris@16: template< Chris@16: typename U1 = na, typename U2 = na, typename U3 = na Chris@16: , typename U4 = na, typename U5 = na Chris@16: > Chris@16: struct apply Chris@16: { Chris@16: private: Chris@16: typedef aux::replace_unnamed_arg< F, mpl::arg<1> > r0; Chris@16: typedef typename r0::type a0; Chris@16: typedef typename r0::next n1; Chris@16: typedef typename aux::resolve_bind_arg< a0,U1,U2,U3,U4,U5 >::type f_; Chris@16: /// Chris@16: public: Chris@16: typedef typename apply_wrap0< Chris@16: f_ Chris@16: >::type type; Chris@16: Chris@16: }; Chris@16: }; Chris@16: Chris@16: namespace aux { Chris@16: Chris@16: template< Chris@16: typename F Chris@16: > Chris@16: aux::yes_tag Chris@16: is_bind_helper(bind0*); Chris@16: Chris@16: } // namespace aux Chris@16: Chris@16: BOOST_MPL_AUX_ARITY_SPEC(1, bind0) Chris@16: BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(1, bind0) Chris@16: Chris@16: template< Chris@16: typename F, typename T1 Chris@16: > Chris@16: struct bind1 Chris@16: { Chris@16: template< Chris@16: typename U1 = na, typename U2 = na, typename U3 = na Chris@16: , typename U4 = na, typename U5 = na Chris@16: > Chris@16: struct apply Chris@16: { Chris@16: private: Chris@16: typedef aux::replace_unnamed_arg< F, mpl::arg<1> > r0; Chris@16: typedef typename r0::type a0; Chris@16: typedef typename r0::next n1; Chris@16: typedef typename aux::resolve_bind_arg< a0,U1,U2,U3,U4,U5 >::type f_; Chris@16: /// Chris@16: typedef aux::replace_unnamed_arg< T1,n1 > r1; Chris@16: typedef typename r1::type a1; Chris@16: typedef typename r1::next n2; Chris@16: typedef aux::resolve_bind_arg< a1,U1,U2,U3,U4,U5 > t1; Chris@16: /// Chris@16: public: Chris@16: typedef typename apply_wrap1< Chris@16: f_ Chris@16: , typename t1::type Chris@16: >::type type; Chris@16: Chris@16: }; Chris@16: }; Chris@16: Chris@16: namespace aux { Chris@16: Chris@16: template< Chris@16: typename F, typename T1 Chris@16: > Chris@16: aux::yes_tag Chris@16: is_bind_helper(bind1< F,T1 >*); Chris@16: Chris@16: } // namespace aux Chris@16: Chris@16: BOOST_MPL_AUX_ARITY_SPEC(2, bind1) Chris@16: BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(2, bind1) Chris@16: Chris@16: template< Chris@16: typename F, typename T1, typename T2 Chris@16: > Chris@16: struct bind2 Chris@16: { Chris@16: template< Chris@16: typename U1 = na, typename U2 = na, typename U3 = na Chris@16: , typename U4 = na, typename U5 = na Chris@16: > Chris@16: struct apply Chris@16: { Chris@16: private: Chris@16: typedef aux::replace_unnamed_arg< F, mpl::arg<1> > r0; Chris@16: typedef typename r0::type a0; Chris@16: typedef typename r0::next n1; Chris@16: typedef typename aux::resolve_bind_arg< a0,U1,U2,U3,U4,U5 >::type f_; Chris@16: /// Chris@16: typedef aux::replace_unnamed_arg< T1,n1 > r1; Chris@16: typedef typename r1::type a1; Chris@16: typedef typename r1::next n2; Chris@16: typedef aux::resolve_bind_arg< a1,U1,U2,U3,U4,U5 > t1; Chris@16: /// Chris@16: typedef aux::replace_unnamed_arg< T2,n2 > r2; Chris@16: typedef typename r2::type a2; Chris@16: typedef typename r2::next n3; Chris@16: typedef aux::resolve_bind_arg< a2,U1,U2,U3,U4,U5 > t2; Chris@16: /// Chris@16: public: Chris@16: typedef typename apply_wrap2< Chris@16: f_ Chris@16: , typename t1::type, typename t2::type Chris@16: >::type type; Chris@16: Chris@16: }; Chris@16: }; Chris@16: Chris@16: namespace aux { Chris@16: Chris@16: template< Chris@16: typename F, typename T1, typename T2 Chris@16: > Chris@16: aux::yes_tag Chris@16: is_bind_helper(bind2< F,T1,T2 >*); Chris@16: Chris@16: } // namespace aux Chris@16: Chris@16: BOOST_MPL_AUX_ARITY_SPEC(3, bind2) Chris@16: BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(3, bind2) Chris@16: Chris@16: template< Chris@16: typename F, typename T1, typename T2, typename T3 Chris@16: > Chris@16: struct bind3 Chris@16: { Chris@16: template< Chris@16: typename U1 = na, typename U2 = na, typename U3 = na Chris@16: , typename U4 = na, typename U5 = na Chris@16: > Chris@16: struct apply Chris@16: { Chris@16: private: Chris@16: typedef aux::replace_unnamed_arg< F, mpl::arg<1> > r0; Chris@16: typedef typename r0::type a0; Chris@16: typedef typename r0::next n1; Chris@16: typedef typename aux::resolve_bind_arg< a0,U1,U2,U3,U4,U5 >::type f_; Chris@16: /// Chris@16: typedef aux::replace_unnamed_arg< T1,n1 > r1; Chris@16: typedef typename r1::type a1; Chris@16: typedef typename r1::next n2; Chris@16: typedef aux::resolve_bind_arg< a1,U1,U2,U3,U4,U5 > t1; Chris@16: /// Chris@16: typedef aux::replace_unnamed_arg< T2,n2 > r2; Chris@16: typedef typename r2::type a2; Chris@16: typedef typename r2::next n3; Chris@16: typedef aux::resolve_bind_arg< a2,U1,U2,U3,U4,U5 > t2; Chris@16: /// Chris@16: typedef aux::replace_unnamed_arg< T3,n3 > r3; Chris@16: typedef typename r3::type a3; Chris@16: typedef typename r3::next n4; Chris@16: typedef aux::resolve_bind_arg< a3,U1,U2,U3,U4,U5 > t3; Chris@16: /// Chris@16: public: Chris@16: typedef typename apply_wrap3< Chris@16: f_ Chris@16: , typename t1::type, typename t2::type, typename t3::type Chris@16: >::type type; Chris@16: Chris@16: }; Chris@16: }; Chris@16: Chris@16: namespace aux { Chris@16: Chris@16: template< Chris@16: typename F, typename T1, typename T2, typename T3 Chris@16: > Chris@16: aux::yes_tag Chris@16: is_bind_helper(bind3< F,T1,T2,T3 >*); Chris@16: Chris@16: } // namespace aux Chris@16: Chris@16: BOOST_MPL_AUX_ARITY_SPEC(4, bind3) Chris@16: BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(4, bind3) Chris@16: Chris@16: template< Chris@16: typename F, typename T1, typename T2, typename T3, typename T4 Chris@16: > Chris@16: struct bind4 Chris@16: { Chris@16: template< Chris@16: typename U1 = na, typename U2 = na, typename U3 = na Chris@16: , typename U4 = na, typename U5 = na Chris@16: > Chris@16: struct apply Chris@16: { Chris@16: private: Chris@16: typedef aux::replace_unnamed_arg< F, mpl::arg<1> > r0; Chris@16: typedef typename r0::type a0; Chris@16: typedef typename r0::next n1; Chris@16: typedef typename aux::resolve_bind_arg< a0,U1,U2,U3,U4,U5 >::type f_; Chris@16: /// Chris@16: typedef aux::replace_unnamed_arg< T1,n1 > r1; Chris@16: typedef typename r1::type a1; Chris@16: typedef typename r1::next n2; Chris@16: typedef aux::resolve_bind_arg< a1,U1,U2,U3,U4,U5 > t1; Chris@16: /// Chris@16: typedef aux::replace_unnamed_arg< T2,n2 > r2; Chris@16: typedef typename r2::type a2; Chris@16: typedef typename r2::next n3; Chris@16: typedef aux::resolve_bind_arg< a2,U1,U2,U3,U4,U5 > t2; Chris@16: /// Chris@16: typedef aux::replace_unnamed_arg< T3,n3 > r3; Chris@16: typedef typename r3::type a3; Chris@16: typedef typename r3::next n4; Chris@16: typedef aux::resolve_bind_arg< a3,U1,U2,U3,U4,U5 > t3; Chris@16: /// Chris@16: typedef aux::replace_unnamed_arg< T4,n4 > r4; Chris@16: typedef typename r4::type a4; Chris@16: typedef typename r4::next n5; Chris@16: typedef aux::resolve_bind_arg< a4,U1,U2,U3,U4,U5 > t4; Chris@16: /// Chris@16: public: Chris@16: typedef typename apply_wrap4< Chris@16: f_ Chris@16: , typename t1::type, typename t2::type, typename t3::type Chris@16: , typename t4::type Chris@16: >::type type; Chris@16: Chris@16: }; Chris@16: }; Chris@16: Chris@16: namespace aux { Chris@16: Chris@16: template< Chris@16: typename F, typename T1, typename T2, typename T3, typename T4 Chris@16: > Chris@16: aux::yes_tag Chris@16: is_bind_helper(bind4< F,T1,T2,T3,T4 >*); Chris@16: Chris@16: } // namespace aux Chris@16: Chris@16: BOOST_MPL_AUX_ARITY_SPEC(5, bind4) Chris@16: BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(5, bind4) Chris@16: Chris@16: template< Chris@16: typename F, typename T1, typename T2, typename T3, typename T4 Chris@16: , typename T5 Chris@16: > Chris@16: struct bind5 Chris@16: { Chris@16: template< Chris@16: typename U1 = na, typename U2 = na, typename U3 = na Chris@16: , typename U4 = na, typename U5 = na Chris@16: > Chris@16: struct apply Chris@16: { Chris@16: private: Chris@16: typedef aux::replace_unnamed_arg< F, mpl::arg<1> > r0; Chris@16: typedef typename r0::type a0; Chris@16: typedef typename r0::next n1; Chris@16: typedef typename aux::resolve_bind_arg< a0,U1,U2,U3,U4,U5 >::type f_; Chris@16: /// Chris@16: typedef aux::replace_unnamed_arg< T1,n1 > r1; Chris@16: typedef typename r1::type a1; Chris@16: typedef typename r1::next n2; Chris@16: typedef aux::resolve_bind_arg< a1,U1,U2,U3,U4,U5 > t1; Chris@16: /// Chris@16: typedef aux::replace_unnamed_arg< T2,n2 > r2; Chris@16: typedef typename r2::type a2; Chris@16: typedef typename r2::next n3; Chris@16: typedef aux::resolve_bind_arg< a2,U1,U2,U3,U4,U5 > t2; Chris@16: /// Chris@16: typedef aux::replace_unnamed_arg< T3,n3 > r3; Chris@16: typedef typename r3::type a3; Chris@16: typedef typename r3::next n4; Chris@16: typedef aux::resolve_bind_arg< a3,U1,U2,U3,U4,U5 > t3; Chris@16: /// Chris@16: typedef aux::replace_unnamed_arg< T4,n4 > r4; Chris@16: typedef typename r4::type a4; Chris@16: typedef typename r4::next n5; Chris@16: typedef aux::resolve_bind_arg< a4,U1,U2,U3,U4,U5 > t4; Chris@16: /// Chris@16: typedef aux::replace_unnamed_arg< T5,n5 > r5; Chris@16: typedef typename r5::type a5; Chris@16: typedef typename r5::next n6; Chris@16: typedef aux::resolve_bind_arg< a5,U1,U2,U3,U4,U5 > t5; Chris@16: /// Chris@16: public: Chris@16: typedef typename apply_wrap5< Chris@16: f_ Chris@16: , typename t1::type, typename t2::type, typename t3::type Chris@16: , typename t4::type, typename t5::type Chris@16: >::type type; Chris@16: Chris@16: }; Chris@16: }; Chris@16: Chris@16: namespace aux { Chris@16: Chris@16: template< Chris@16: typename F, typename T1, typename T2, typename T3, typename T4 Chris@16: , typename T5 Chris@16: > Chris@16: aux::yes_tag Chris@16: is_bind_helper(bind5< F,T1,T2,T3,T4,T5 >*); Chris@16: Chris@16: } // namespace aux Chris@16: Chris@16: BOOST_MPL_AUX_ARITY_SPEC(6, bind5) Chris@16: BOOST_MPL_AUX_TEMPLATE_ARITY_SPEC(6, bind5) Chris@16: }} Chris@16: