]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/phoenix/test/scope/lambda_tests1b1s.cpp
1 /*=============================================================================
2 Copyright (c) 2001-2007 Joel de Guzman
3 Copyright (c) 2014 John Fletcher
5 Distributed under the Boost Software License, Version 1.0. (See accompanying
6 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 ==============================================================================*/
15 #include <boost/detail/lightweight_test.hpp>
16 #include <boost/phoenix/core.hpp>
17 #include <boost/phoenix/operator.hpp>
18 #include <boost/phoenix/function.hpp>
19 //#include <boost/phoenix/bind.hpp>
20 #include <boost/phoenix/scope.hpp>
27 using boost::phoenix::lambda
;
28 using boost::phoenix::let
;
29 using boost::phoenix::ref
;
30 using boost::phoenix::val
;
31 using boost::phoenix::arg_names::_1
;
32 //using boost::phoenix::arg_names::_2;
33 using boost::phoenix::local_names::_a
;
34 //using boost::phoenix::local_names::_b;
35 // using boost::phoenix::placeholders::arg1;
42 char const* y
= "hello";
45 //BOOST_TEST(lambda[_1](x)(y) == y);
46 //BOOST_TEST(lambda(_a = _1)[_a](x)(y) == x);
47 //BOOST_TEST(lambda(_a = _1)[lambda[_a]](x)(y)(z) == x);
48 BOOST_TEST(lambda(_a
= _1
)[lambda
[_a
+ _1
]](x
)(y
)(x
) == 2);
49 //BOOST_TEST(lambda(_a = _1)[lambda(_b = _1)[_a + _b + _1]](x)(x2)(x3) == 6);
56 (_1 + lambda(_a = _1)[_a + _1 + 2])(x)(y) == 1+1+10+2
74 return boost::report_errors();