c++boost.gif (8819 bytes)

#include <boost/preprocessor/stringize.hpp>


#define BOOST_PP_STRINGIZE(X)

Delays the stringization of X.

For example,

  #define NOTE(STR)\
    message(__FILE__ "(" BOOST_PP_STRINGIZE(__LINE__) ") : " STR)

  // ...

  #pragma NOTE("TBD!")

expands to:

  #pragma message("examples.cpp" "(" "20" ") : " "TBD!")

The use of BOOST_PP_STRINGIZE() above lets the PP expand the __LINE__ before stringizing it. If # would be used directly, the code would expand to:

  #pragma message("examples.cpp" "(" "__LINE__" ") : " "TBD!")

#define BOOST_PREPROCESSOR_STRINGIZE(E)

Obsolete. Use BOOST_PP_STRINGIZE().


(C) Copyright Housemarque Oy 2002

Permission to copy, use, modify, sell and distribute this document is granted provided this copyright notice appears in all copies. This document is provided "as is" without express or implied warranty, and with no claim as to its suitability for any purpose.

Generated: