1 .. Metafunctions/Composition and Argument Binding//protect |60
25 ``protect`` is an identity wrapper for a |Metafunction Class| that prevents
26 its argument from being recognized as a |bind expression|.
34 #include <boost/mpl/protect.hpp>
40 +---------------+---------------------------+---------------------------------------+
41 | Parameter | Requirement | Description |
42 +===============+===========================+=======================================+
43 | ``F`` | |Metafunction Class| | A metafunction class to wrap. |
44 +---------------+---------------------------+---------------------------------------+
50 For any |Metafunction Class| ``f``:
61 If ``f`` is a |bind expression|, equivalent to
68 typename U1 = |unspecified|\,\ |...| typename U\ *n* = |unspecified|
71 : apply_wrap\ *n*\<f,U1,\ |...|\ U\ *n*\ >
76 otherwise equivalent to ``typedef f g;``.
86 template< typename T1, typename T2 > struct apply
92 typedef bind< quote\ ``3``\<if\_>,_1,_2,bind<f,_1,_2> > b1;
93 typedef bind< quote\ ``3``\<if\_>,_1,_2,protect< bind<f,_1,_2> > > b2;
95 typedef apply_wrap\ ``2``\< b1,false\_,char >::type r1;
96 typedef apply_wrap\ ``2``\< b2,false\_,char >::type r2;
98 BOOST_MPL_ASSERT(( is_same<r1,char> ));
99 BOOST_MPL_ASSERT(( is_same<r2,protect< bind<f,_1,_2> > > ));
105 |Composition and Argument Binding|, |Invocation|, |bind|, |quote|, |apply_wrap|
108 .. copyright:: Copyright © 2001-2009 Aleksey Gurtovoy and David Abrahams
109 Distributed under the Boost Software License, Version 1.0. (See accompanying
110 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)