| 1 | #include <boost/mpl/assert.hpp>
|
|---|
| 2 | #include <boost/mpl/lambda.hpp>
|
|---|
| 3 | #include <boost/mpl/not.hpp>
|
|---|
| 4 | #include <boost/mpl/placeholders.hpp>
|
|---|
| 5 | #include <boost/mpl/plus.hpp>
|
|---|
| 6 | using namespace boost::mpl;
|
|---|
| 7 |
|
|---|
| 8 | // define if your boost distribution includes boost::tti
|
|---|
| 9 | #define BOOST_TTI
|
|---|
| 10 | #ifdef BOOST_TTI
|
|---|
| 11 | #include <boost/tti/detail/dlambda.hpp>
|
|---|
| 12 | #endif // BOOST_TTI
|
|---|
| 13 |
|
|---|
| 14 | struct MetafunctionClass
|
|---|
| 15 | {
|
|---|
| 16 | template<typename T1, typename T2>
|
|---|
| 17 | struct apply
|
|---|
| 18 | {
|
|---|
| 19 | typedef typename plus<T1,T2>::type type;
|
|---|
| 20 | };
|
|---|
| 21 | };
|
|---|
| 22 |
|
|---|
| 23 | // work correctly:
|
|---|
| 24 | BOOST_MPL_ASSERT((is_lambda_expression<plus<_1, _2> >));
|
|---|
| 25 | #ifdef BOOST_TTI
|
|---|
| 26 | BOOST_MPL_ASSERT((boost::tti::detail::is_lambda_expression<MetafunctionClass>));
|
|---|
| 27 | #endif // BOOST_TTI
|
|---|
| 28 | // does not work correctly
|
|---|
| 29 | BOOST_MPL_ASSERT((not_<is_lambda_expression<MetafunctionClass> >));
|
|---|
| 30 |
|
|---|
| 31 | int main(int argc, char * argv[])
|
|---|
| 32 | {
|
|---|
| 33 | }
|
|---|