| 1 | /*============================================================================= |
|---|---|
| 2 | Copyright (c) 2014 John Fletcher |
| 3 | |
| 4 | Distributed under the Boost Software License, Version 1.0. (See accompanying |
| 5 | file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |
| 6 | ==============================================================================*/ |
| 7 | |
| 8 | #include <boost/detail/lightweight_test.hpp> |
| 9 | |
| 10 | #include <boost/phoenix/core.hpp> |
| 11 | #include <boost/phoenix/operator.hpp> |
| 12 | #include <boost/phoenix/function.hpp> |
| 13 | #include <boost/phoenix/bind.hpp> |
| 14 | #include <boost/phoenix/scope.hpp> |
| 15 | |
| 16 | |
| 17 | int |
| 18 | main() |
| 19 | { |
| 20 | using boost::phoenix::lambda; |
| 21 | using boost::phoenix::let; |
| 22 | using boost::phoenix::ref; |
| 23 | using boost::phoenix::val; |
| 24 | using boost::phoenix::arg_names::_1; |
| 25 | //using boost::phoenix::arg_names::_2; |
| 26 | using boost::phoenix::local_names::_a; |
| 27 | // using boost::phoenix::local_names::_b; |
| 28 | //using boost::phoenix::placeholders::arg1; |
| 29 | |
| 30 | { |
| 31 | int x = 1; |
| 32 | int y = lambda[_1]()(x); |
| 33 | BOOST_TEST(x == y); |
| 34 | } |
| 35 | |
| 36 | { |
| 37 | int x = 1; |
| 38 | int y = lambda(_a = _1)[_a+1](x)(); |
| 39 | BOOST_TEST(x+1 == y); |
| 40 | } |
| 41 | |
| 42 | { |
| 43 | int x = lambda[val(t: 1)]()(); |
| 44 | BOOST_TEST(x == 1); |
| 45 | } |
| 46 | |
| 47 | return boost::report_errors(); |
| 48 | } |
| 49 |
