lambda_tests21.cpp 1006 B

1234567891011121314151617181920212223242526272829
  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/self.hpp>
  11. #include <boost/phoenix/scope/lambda.hpp>
  12. #include <boost/phoenix/scope/let.hpp>
  13. int main()
  14. {
  15. using boost::phoenix::lambda;
  16. using boost::phoenix::let;
  17. using boost::phoenix::arg_names::_1;
  18. using boost::phoenix::arg_names::_2;
  19. using boost::phoenix::local_names::_a;
  20. int i = 0;
  21. int j = 2;
  22. BOOST_TEST(lambda[let(_a = _1)[_a = _2]]()(i, j) == j);
  23. BOOST_TEST(i == j);
  24. return boost::report_errors();
  25. }