blob: f3b4c936af1e54755e14becd323b889326eb47d8 [file] [log] [blame]
/*=============================================================================
Copyright (c) 2001-2007 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
template <>
struct member_function_ptr_impl<1>
{
template <typename RT, typename FP>
struct impl
{
typedef RT result_type;
impl(FP fp)
: fp(fp) {}
template <typename Class, typename A0>
RT operator()(Class& obj, A0 & a0) const
{
BOOST_PROTO_USE_GET_POINTER();
typedef typename proto::detail::classtypeof<FP>::type class_type;
return (BOOST_PROTO_GET_POINTER(class_type, obj)->*fp)(a0);
}
template <typename Class, typename A0>
RT operator()(Class* obj, A0 & a0) const
{
return (obj->*fp)(a0);
}
FP fp;
};
};
template <>
struct member_function_ptr_impl<2>
{
template <typename RT, typename FP>
struct impl
{
typedef RT result_type;
impl(FP fp)
: fp(fp) {}
template <typename Class, typename A0 , typename A1>
RT operator()(Class& obj, A0 & a0 , A1 & a1) const
{
BOOST_PROTO_USE_GET_POINTER();
typedef typename proto::detail::classtypeof<FP>::type class_type;
return (BOOST_PROTO_GET_POINTER(class_type, obj)->*fp)(a0 , a1);
}
template <typename Class, typename A0 , typename A1>
RT operator()(Class* obj, A0 & a0 , A1 & a1) const
{
return (obj->*fp)(a0 , a1);
}
FP fp;
};
};
template <>
struct member_function_ptr_impl<3>
{
template <typename RT, typename FP>
struct impl
{
typedef RT result_type;
impl(FP fp)
: fp(fp) {}
template <typename Class, typename A0 , typename A1 , typename A2>
RT operator()(Class& obj, A0 & a0 , A1 & a1 , A2 & a2) const
{
BOOST_PROTO_USE_GET_POINTER();
typedef typename proto::detail::classtypeof<FP>::type class_type;
return (BOOST_PROTO_GET_POINTER(class_type, obj)->*fp)(a0 , a1 , a2);
}
template <typename Class, typename A0 , typename A1 , typename A2>
RT operator()(Class* obj, A0 & a0 , A1 & a1 , A2 & a2) const
{
return (obj->*fp)(a0 , a1 , a2);
}
FP fp;
};
};
template <>
struct member_function_ptr_impl<4>
{
template <typename RT, typename FP>
struct impl
{
typedef RT result_type;
impl(FP fp)
: fp(fp) {}
template <typename Class, typename A0 , typename A1 , typename A2 , typename A3>
RT operator()(Class& obj, A0 & a0 , A1 & a1 , A2 & a2 , A3 & a3) const
{
BOOST_PROTO_USE_GET_POINTER();
typedef typename proto::detail::classtypeof<FP>::type class_type;
return (BOOST_PROTO_GET_POINTER(class_type, obj)->*fp)(a0 , a1 , a2 , a3);
}
template <typename Class, typename A0 , typename A1 , typename A2 , typename A3>
RT operator()(Class* obj, A0 & a0 , A1 & a1 , A2 & a2 , A3 & a3) const
{
return (obj->*fp)(a0 , a1 , a2 , a3);
}
FP fp;
};
};
template <>
struct member_function_ptr_impl<5>
{
template <typename RT, typename FP>
struct impl
{
typedef RT result_type;
impl(FP fp)
: fp(fp) {}
template <typename Class, typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
RT operator()(Class& obj, A0 & a0 , A1 & a1 , A2 & a2 , A3 & a3 , A4 & a4) const
{
BOOST_PROTO_USE_GET_POINTER();
typedef typename proto::detail::classtypeof<FP>::type class_type;
return (BOOST_PROTO_GET_POINTER(class_type, obj)->*fp)(a0 , a1 , a2 , a3 , a4);
}
template <typename Class, typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
RT operator()(Class* obj, A0 & a0 , A1 & a1 , A2 & a2 , A3 & a3 , A4 & a4) const
{
return (obj->*fp)(a0 , a1 , a2 , a3 , a4);
}
FP fp;
};
};
template <>
struct member_function_ptr_impl<6>
{
template <typename RT, typename FP>
struct impl
{
typedef RT result_type;
impl(FP fp)
: fp(fp) {}
template <typename Class, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
RT operator()(Class& obj, A0 & a0 , A1 & a1 , A2 & a2 , A3 & a3 , A4 & a4 , A5 & a5) const
{
BOOST_PROTO_USE_GET_POINTER();
typedef typename proto::detail::classtypeof<FP>::type class_type;
return (BOOST_PROTO_GET_POINTER(class_type, obj)->*fp)(a0 , a1 , a2 , a3 , a4 , a5);
}
template <typename Class, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
RT operator()(Class* obj, A0 & a0 , A1 & a1 , A2 & a2 , A3 & a3 , A4 & a4 , A5 & a5) const
{
return (obj->*fp)(a0 , a1 , a2 , a3 , a4 , a5);
}
FP fp;
};
};
template <>
struct member_function_ptr_impl<7>
{
template <typename RT, typename FP>
struct impl
{
typedef RT result_type;
impl(FP fp)
: fp(fp) {}
template <typename Class, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
RT operator()(Class& obj, A0 & a0 , A1 & a1 , A2 & a2 , A3 & a3 , A4 & a4 , A5 & a5 , A6 & a6) const
{
BOOST_PROTO_USE_GET_POINTER();
typedef typename proto::detail::classtypeof<FP>::type class_type;
return (BOOST_PROTO_GET_POINTER(class_type, obj)->*fp)(a0 , a1 , a2 , a3 , a4 , a5 , a6);
}
template <typename Class, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
RT operator()(Class* obj, A0 & a0 , A1 & a1 , A2 & a2 , A3 & a3 , A4 & a4 , A5 & a5 , A6 & a6) const
{
return (obj->*fp)(a0 , a1 , a2 , a3 , a4 , a5 , a6);
}
FP fp;
};
};
template <>
struct member_function_ptr_impl<8>
{
template <typename RT, typename FP>
struct impl
{
typedef RT result_type;
impl(FP fp)
: fp(fp) {}
template <typename Class, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
RT operator()(Class& obj, A0 & a0 , A1 & a1 , A2 & a2 , A3 & a3 , A4 & a4 , A5 & a5 , A6 & a6 , A7 & a7) const
{
BOOST_PROTO_USE_GET_POINTER();
typedef typename proto::detail::classtypeof<FP>::type class_type;
return (BOOST_PROTO_GET_POINTER(class_type, obj)->*fp)(a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7);
}
template <typename Class, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
RT operator()(Class* obj, A0 & a0 , A1 & a1 , A2 & a2 , A3 & a3 , A4 & a4 , A5 & a5 , A6 & a6 , A7 & a7) const
{
return (obj->*fp)(a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7);
}
FP fp;
};
};
template <>
struct member_function_ptr_impl<9>
{
template <typename RT, typename FP>
struct impl
{
typedef RT result_type;
impl(FP fp)
: fp(fp) {}
template <typename Class, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
RT operator()(Class& obj, A0 & a0 , A1 & a1 , A2 & a2 , A3 & a3 , A4 & a4 , A5 & a5 , A6 & a6 , A7 & a7 , A8 & a8) const
{
BOOST_PROTO_USE_GET_POINTER();
typedef typename proto::detail::classtypeof<FP>::type class_type;
return (BOOST_PROTO_GET_POINTER(class_type, obj)->*fp)(a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8);
}
template <typename Class, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
RT operator()(Class* obj, A0 & a0 , A1 & a1 , A2 & a2 , A3 & a3 , A4 & a4 , A5 & a5 , A6 & a6 , A7 & a7 , A8 & a8) const
{
return (obj->*fp)(a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8);
}
FP fp;
};
};
template <>
struct member_function_ptr_impl<10>
{
template <typename RT, typename FP>
struct impl
{
typedef RT result_type;
impl(FP fp)
: fp(fp) {}
template <typename Class, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9>
RT operator()(Class& obj, A0 & a0 , A1 & a1 , A2 & a2 , A3 & a3 , A4 & a4 , A5 & a5 , A6 & a6 , A7 & a7 , A8 & a8 , A9 & a9) const
{
BOOST_PROTO_USE_GET_POINTER();
typedef typename proto::detail::classtypeof<FP>::type class_type;
return (BOOST_PROTO_GET_POINTER(class_type, obj)->*fp)(a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8 , a9);
}
template <typename Class, typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9>
RT operator()(Class* obj, A0 & a0 , A1 & a1 , A2 & a2 , A3 & a3 , A4 & a4 , A5 & a5 , A6 & a6 , A7 & a7 , A8 & a8 , A9 & a9) const
{
return (obj->*fp)(a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8 , a9);
}
FP fp;
};
};