arguments.cpp 710 B

123456789101112131415161718192021
  1. /*=============================================================================
  2. Copyright (c) 2001-2007 Joel de Guzman
  3. Distributed under the Boost Software License, Version 1.0. (See accompanying
  4. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  5. ==============================================================================*/
  6. #include <iostream>
  7. #include <boost/phoenix/core.hpp>
  8. int
  9. main()
  10. {
  11. using boost::phoenix::arg_names::arg1;
  12. using boost::phoenix::arg_names::arg2;
  13. int i = 3;
  14. char const* s = "Hello World";
  15. std::cout << arg1(i) << std::endl; // prints 3
  16. std::cout << arg2(i, s) << std::endl; // prints "Hello World"
  17. return 0;
  18. }