lambda_tests3.cpp 832 B

12345678910111213141516171819202122232425
  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/scope/lambda.hpp>
  12. int main()
  13. {
  14. using boost::phoenix::lambda;
  15. using boost::phoenix::arg_names::_1;
  16. int x = 1, y = 10;
  17. BOOST_TEST(
  18. (_1 + lambda[-_1])(x)(y) == 1+-10
  19. );
  20. return boost::report_errors();
  21. }