.. Metafunctions/Composition and Argument Binding//protect |60 protect ======= Synopsis -------- .. parsed-literal:: template< typename F > struct protect { // |unspecified| // |...| }; Description ----------- ``protect`` is an identity wrapper for a |Metafunction Class| that prevents its argument from being recognized as a |bind expression|. Header ------ .. parsed-literal:: #include Parameters ---------- +---------------+---------------------------+---------------------------------------+ | Parameter | Requirement | Description | +===============+===========================+=======================================+ | ``F`` | |Metafunction Class| | A metafunction class to wrap. | +---------------+---------------------------+---------------------------------------+ Expression semantics -------------------- For any |Metafunction Class| ``f``: .. parsed-literal:: typedef protect g; :Return type: |Metafunction Class|. :Semantics: If ``f`` is a |bind expression|, equivalent to .. parsed-literal:: struct g { template< typename U1 = |unspecified|\,\ |...| typename U\ *n* = |unspecified| > struct apply : apply_wrap\ *n*\ { }; }; otherwise equivalent to ``typedef f g;``. Example ------- .. parsed-literal:: FIXME struct f { template< typename T1, typename T2 > struct apply { // |...| }; }; typedef bind<_1, protect< bind > > 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 )); See also -------- |Composition and Argument Binding|, |Invocation|, |bind|, |quote|, |apply_wrap|