...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 / Composition and Argument Binding / lambda |
template< typename X , typename Tag = unspecified > struct lambda { typedef unspecified type; };
If X is a Placeholder Expression, transforms X into a corresponding Metafunction Class, otherwise X is returned unchanged.
#include <boost/mpl/lambda.hpp>
Parameter | Requirement | Description |
---|---|---|
X | Any type | An expression to transform. |
Tag | Any type | A tag determining transform semantics. |
For arbitrary types x and tag:
typedef lambda::type f;
Return type: | |
---|---|
Semantics: | If x is a Placeholder Expression in a general form X typedef protect< bind< quoten otherwise, f is identical to x. |
typedef lambda::type f;
Return type: | |
---|---|
Semantics: | If x is a Placeholder Expression in a general form X typedef protect< bind< quoten otherwise, f is identical to x. |
template< typename N1, typename N2 > struct int_plus : int_<( N1::value + N2::value )> { }; typedef lambda< int_plus<_1, int_<42> > >::type f1; typedef bind< quote2, _1, int_<42> > f2; typedef f1::apply<42>::type r1; typedef f2::apply<42>::type r2; BOOST_MPL_ASSERT_RELATION( r1::value, ==, 84 ); BOOST_MPL_ASSERT_RELATION( r2::value, ==, 84 );