|
The MPL Reference Manual: argBoost , ,
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 |
Интегральная постоянная |
Несколько аргументов в пользу возвращения. |
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 > ));
Статья The MPL Reference Manual: arg раздела может быть полезна для разработчиков на c++ и boost.
:: Главная :: ::
|
|