lambda_tests5.cpp 886 B

123456789101112131415161718192021222324252627
  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. int main()
  13. {
  14. using boost::phoenix::lambda;
  15. using boost::phoenix::arg_names::_1;
  16. using boost::phoenix::local_names::_a;
  17. int x = 4;
  18. int y = 5;
  19. lambda(_a = _1)[_a = 555](x)();
  20. BOOST_TEST(x == 555);
  21. (void)y;
  22. return boost::report_errors();
  23. }