template< int n > struct arg;
template<> struct arg<1>
{
template< typename A1,... typename An = unspecified >
struct apply
{
typedef A1 type;
};
};
...
template<> struct arg<n>
{
template< typename A1,... typename An >
struct apply
{
typedef An type;
};
};
Parameter |
Requirement |
Description |
n |
An integral constant |
A number of argument to return. |
typedef apply_wrap5< arg<1>,bool,char,short,int,long >::type t1;
typedef apply_wrap5< arg<3>,bool,char,short,int,long >::type t3;
BOOST_MPL_ASSERT(( is_same< t1, bool > ));
BOOST_MPL_ASSERT(( is_same< t3, short > ));