lambda_tests13.cpp 1003 B

12345678910111213141516171819202122232425262728
  1. /*=============================================================================
  2. Copyright (c) 2001-2007 Joel de Guzman
  3. Copyright (c) 2014 John Fletcher
  4. Copyright (c) 2018 Kohei Takahashi
  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. ==============================================================================*/
  8. #include <boost/detail/lightweight_test.hpp>
  9. #include <boost/phoenix/core.hpp>
  10. #include <boost/phoenix/operator/arithmetic.hpp>
  11. #include <boost/phoenix/operator/self.hpp>
  12. #include <boost/phoenix/scope/lambda.hpp>
  13. int main()
  14. {
  15. using boost::phoenix::lambda;
  16. using boost::phoenix::arg_names::_1;
  17. using boost::phoenix::local_names::_a;
  18. using boost::phoenix::local_names::_b;
  19. int x = 1;
  20. long x2 = 2;
  21. short x3 = 3;
  22. BOOST_TEST(lambda(_a = _1)[lambda(_b = _1)[_a + _b + _1]](x)(x2)(x3) == 6);
  23. return boost::report_errors();
  24. }