example.cpp 1.2 KB

123456789101112131415161718192021222324
  1. /*=============================================================================
  2. Boost.Wave: A Standard compliant C++ preprocessor library
  3. Example demonstrating how to preprocess the token stream generated by a
  4. #pragma directive
  5. http://www.boost.org/
  6. Copyright (c) 2001-2010 Hartmut Kaiser. Distributed under the Boost
  7. Software License, Version 1.0. (See accompanying file
  8. LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  9. =============================================================================*/
  10. ///////////////////////////////////////////////////////////////////////////////
  11. // This special pragma is implemented by the interpret_pragma hook function
  12. // provided in the preprocess_pragma_output_hooks policy class. This
  13. // #pragma preprocesses the provided arguments in the current context.
  14. #pragma wave pp ( \
  15. "#define A() \"some text\" and more\n" \
  16. "#define B() 1.0\n" \
  17. ) \
  18. /**/
  19. A() // this should produce: "some text" and more
  20. B() // and this expands to 1.0