lambda_tests10.cpp 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  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/scope/lambda.hpp>
  14. struct zzz {};
  15. int main()
  16. {
  17. #if defined(RUNNING_ON_APPVEYOR) && BOOST_WORKAROUND(BOOST_MSVC, == 1800)
  18. // skip test
  19. #else
  20. using boost::phoenix::lambda;
  21. using boost::phoenix::arg_names::_1;
  22. using boost::phoenix::local_names::_a;
  23. int x = 1;
  24. char const* y = "hello";
  25. zzz z;
  26. BOOST_TEST(lambda(_a = _1)[lambda[_a]](x)(y)(z) == x);
  27. return boost::report_errors();
  28. #endif
  29. }