...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Front Page / Metafunctions / Invocation / apply_wrap |
template< typename F > struct apply_wrap0 { typedef unspecified type; }; template< typename F, typename A1 > struct apply_wrap1 { typedef unspecified type; }; ... template< typename F, typename A1,... typename An > struct apply_wrapn { typedef unspecified type; };
Invokes a Metafunction Class F with arguments A1,... An.
In essence, apply_wrap forms are nothing more than syntactic wrappers around
F::apply
#include <boost/mpl/apply_wrap.hpp>
Parameter | Requirement | Description |
---|---|---|
F | Metafunction Class | A metafunction class to invoke. |
A1,... An | Any type | Invocation arguments. |
For any Metafunction Class f and arbitrary types a1,... an:
typedef apply_wrapn...an>::type t;
Return type: | Any type. |
---|---|
Semantics: | If n > 0, equivalent to typedef f::apply |
struct f0 { template< typename T = int > struct apply { typedef char type; }; }; struct g0 { struct apply { typedef char type; }; }; struct f2 { template< typename T1, typename T2 > struct apply { typedef T2 type; }; }; typedef apply_wrap0< f0 >::type r1; typedef apply_wrap0< g0 >::type r2; typedef apply_wrap2< f2,int,char >::type r3; BOOST_MPL_ASSERT(( is_same)); BOOST_MPL_ASSERT(( is_same )); BOOST_MPL_ASSERT(( is_same ));