/Src/Dependencies/Boost/libs/phoenix/example/callback.cpp

http://hadesmem.googlecode.com/ · C++ · 24 lines · 15 code · 3 blank · 6 comment · 0 complexity · fded3387bc2949f027e654b5a26da5fb MD5 · raw file

  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. template <typename F>
  9. void print(F f)
  10. {
  11. std::cout << f() << std::endl;
  12. }
  13. int
  14. main()
  15. {
  16. using boost::phoenix::val;
  17. print(val(3));
  18. print(val("Hello World"));
  19. return 0;
  20. }