Nullary metafunction classes are no longer special-cased, and are not identical to nullary metafunctions:
Nullary... |
Before |
Now |
|---|---|---|
metafunction |
f::type |
f::type |
metafunction class |
c::type |
c::apply<>::type or c::apply::type 1 |
This fixes a flaw in the metafunction/metafunction class algebra that long has been the major source of other inconsistencies throughout the library.
apply now automatically invokes lambda on its first argument, e.g. the following is well-formed now:
typedef apply< plus<_1,_1>, int_<2> >::type four;
apply_wrapn auxiliary metafunctions are available for rare cases when it's crutial to eliminate small overhead associated with lambda expressions while still avoiding various compiler bugs known to lurk in the obvious f::template apply<...>::type.
Lambda implementation for broken compilers has been reworked to match as close as possible the semantics of the full-fledged version; consequently, there might be some incorrect code out there that will stop working with the new implementation.
To get the detailed picture of the new apply/lambda semantics, please see the corresponding test case at http://cvs.sourceforge.net/viewcvs.py/boost/boost/libs/mpl/test/apply.cpp?view=markup.
| [1] | The second form is available only on fully conforming compilers. |