| Home | Libraries | People | FAQ | More

## Visual C++ define

Microsoft's Visual C++ compiler, abbreviated VC++, is a very popular compiler but does not implement the standard C++ preprocessor correctly in a number of respects. Because of this the programmer using the VMD needs to occasionally do things differently when VC++ is being used. These "quirks" of VC++ have been smoothed over as much as possible in the VMD library, but are mentioned in further topics and occasionally must be addressed by the programmer using VMD.

The VMD has a macro that indicates when VC++ is the compiler being used. The macro is an object-like macro called BOOST_VMD_MSVC. It is set to 1 when VC++ is being used and set to 0 when VC++ is not being used. You can use this macro in your own macro code whenever you include a VMD header file to write code which may need special processing for VC++ as outlined in this documentation. Your macro processing may therefore occasional take the form of:

    #include <boost/vmd/some_header.hpp>

    #if BOOST_VMD_MSVC

    #define SOME_MACRO ... code for VC++

    #else

    #define SOME_MACRO ... code for all other compilers

    #endif