// Copyright Daniel Wallin 2006. Use, modification and distribution is // subject to 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) #include #include #include #include namespace mpl = boost::mpl; namespace parameter = boost::parameter; template struct a0_is : parameter::template_keyword, T> {}; template struct a1_is : parameter::template_keyword, T> {}; template struct a2_is : parameter::template_keyword, T> {}; template struct a3_is : parameter::template_keyword, T> {}; struct X {}; struct Y : X {}; template < class A0 = parameter::void_ , class A1 = parameter::void_ , class A2 = parameter::void_ , class A3 = parameter::void_ > struct with_ntp { typedef typename parameter::parameters< a0_is<>, a1_is<>, a2_is<> , parameter::optional< parameter::deduced > , boost::is_base_and_derived > >::bind::type args; typedef typename parameter::binding< args, a0_is<>, void* >::type a0; typedef typename parameter::binding< args, a1_is<>, void* >::type a1; typedef typename parameter::binding< args, a2_is<>, void* >::type a2; typedef typename parameter::binding< args, a3_is<>, void* >::type a3; typedef void(*type)(a0,a1,a2,a3); }; BOOST_MPL_ASSERT((boost::is_same< with_ntp<>::type, void(*)(void*,void*,void*,void*) >)); BOOST_MPL_ASSERT((boost::is_same< with_ntp >::type, void(*)(void*,void*,int,void*) >)); BOOST_MPL_ASSERT((boost::is_same< with_ntp >::type, void(*)(void*,int,void*,void*) >)); BOOST_MPL_ASSERT((boost::is_same< with_ntp, a1_is >::type, void(*)(void*,float,int const,void*) >)); BOOST_MPL_ASSERT((boost::is_same< with_ntp::type, void(*)(int const, void*, void*,void*) >)); BOOST_MPL_ASSERT((boost::is_same< with_ntp::type, void(*)(int, float, void*,void*) >)); BOOST_MPL_ASSERT((boost::is_same< with_ntp::type, void(*)(int, float, char,void*) >)); BOOST_MPL_ASSERT((boost::is_same< with_ntp, Y>::type, void(*)(int,void*,void*, Y) >)); BOOST_MPL_ASSERT((boost::is_same< with_ntp, Y>::type, void(*)(int&,void*,char, Y) >));