]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/phoenix/test/scope/lambda_tests3a.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>
25 using boost::phoenix::lambda
;
26 using boost::phoenix::let
;
27 using boost::phoenix::ref
;
28 using boost::phoenix::val
;
29 using boost::phoenix::arg_names::_1
;
30 using boost::phoenix::arg_names::_2
;
31 using boost::phoenix::local_names::_a
;
32 using boost::phoenix::local_names::_b
;
33 // using boost::phoenix::placeholders::arg1;
37 int x = 1, y = 10, z = 13;
40 lambda(_a = _1, _b = _2)
44 (x, z)(y) == x + y + z
50 // $$$ Fixme. This should not be failing $$$
51 //int x = (let(_a = lambda[val(1)])[_a])()();
56 //#if defined(BOOST_GCC_VERSION) && (BOOST_GCC_VERSION >= 50000) && __OPTIMIZE__
57 #if defined(__OPTIMIZE__) && __OPTIMIZE__
58 int x
= (let(_a
= _1
)[bind(_a
)])(lambda
[val(1)]());
60 int x
= (let(_a
= lambda
[val(1)])[bind(_a
)])();
63 // Take this out too, I am not sure about this.
70 BOOST_TEST(lambda[let(_a = _1)[_a = _2]]()(i, j) == j);
75 return boost::report_errors();