lambda_tests22.cpp 1017 B

123456789101112131415161718192021222324252627282930
  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/config.hpp>
  9. #include <boost/detail/workaround.hpp>
  10. #include <boost/detail/lightweight_test.hpp>
  11. #include <boost/phoenix/core.hpp>
  12. #include <boost/phoenix/operator/self.hpp>
  13. #include <boost/phoenix/bind.hpp>
  14. #include <boost/phoenix/scope/lambda.hpp>
  15. #include <boost/phoenix/scope/let.hpp>
  16. int main()
  17. {
  18. using boost::phoenix::lambda;
  19. using boost::phoenix::let;
  20. using boost::phoenix::val;
  21. using boost::phoenix::local_names::_a;
  22. int x = (let(_a = lambda[val(1)])[bind(_a)])();
  23. BOOST_TEST(x == 1);
  24. return boost::report_errors();
  25. }