3rdParty/boost/1.78.0/libs/mpl/doc/refmanual/protect.html
| Prev Next | Back Along | Up Home | Full TOC | Front Page / Metafunctions / Composition and Argument Binding / protect |
template<
typename F
>
struct[protect](./protect.html){
//_unspecified_//_..._};
protect is an identity wrapper for a Metafunction Class that prevents its argument from being recognized as a bind expression.
#include <[boost/mpl/protect.hpp](../../../../boost/mpl/protect.hpp)>
| Parameter | Requirement | Description |
|---|---|---|
| F | Metafunction Class | A metafunction class to wrap. |
For any Metafunction Class f:
typedef[protect](./protect.html)<f> g;
| Return type: |
| | Semantics: |
If f is a bind expression, equivalent to
struct g
{
template<
typename U1 =_unspecified_,_..._typename U_n_=_unspecified_>
struct[apply](./apply.html):[apply\_wrap](./apply-wrap.html)_n_<f,U1,_..._U_n_>
{
};
};
otherwise equivalent to typedef f g;.
|
struct f
{
template< typename T1, typename T2 > struct[apply](./apply.html){
typedef T2 type;
};
};
typedef[bind](./bind.html)<[quote](./quote.html)3<[if\_](./if.html)>,[\_1](./placeholders.html),[\_2](./placeholders.html),[bind](./bind.html)<f,[\_1](./placeholders.html),[\_2](./placeholders.html)> > b1;
typedef[bind](./bind.html)<[quote](./quote.html)3<[if\_](./if.html)>,[\_1](./placeholders.html),[\_2](./placeholders.html),[protect](./protect.html)<[bind](./bind.html)<f,[\_1](./placeholders.html),[\_2](./placeholders.html)> > > b2;
typedef[apply\_wrap](./apply-wrap.html)2< b1,[false\_](./bool.html),char >::type r1;
typedef[apply\_wrap](./apply-wrap.html)2< b2,[false\_](./bool.html),char >::type r2;[BOOST\_MPL\_ASSERT](./assert.html)(( is_same<r1,char> ));[BOOST\_MPL\_ASSERT](./assert.html)(( is_same<r2,[protect](./protect.html)<[bind](./bind.html)<f,[\_1](./placeholders.html),[\_2](./placeholders.html)> > > ));
Composition and Argument Binding, invocation, bind, quote, apply_wrap
| Prev Next | Back Along | Up Home | Full TOC |
Copyright © 2001-2009 Aleksey Gurtovoy and David Abrahams Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |