vmd_vc_isms.qbk 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. [/
  2. (C) Copyright Edward Diener 2011-2015
  3. Distributed under the Boost Software License, Version 1.0.
  4. (See accompanying file LICENSE_1_0.txt or copy at
  5. http://www.boost.org/LICENSE_1_0.txt).
  6. ]
  7. [section:vmd_vc_isms Visual C++ gotchas in VMD]
  8. I have discussed throughout the documentation areas of VMD which need to be
  9. considered when using Microsoft's Visual C++ compilers. The VMD library
  10. supports VC++ versions 8 through the latest 14. These correspond to
  11. Visual Studio 2005 through the current Visual Studio 2015.
  12. I will give here fairly briefly the VC++ quirks which should be taken
  13. into account when using VMD. These quirks exist because the VC++ compiler
  14. does not have a C++ standard conforming preprocessor. More specifically
  15. the VC++ compiler does not follow all of the rules correctly for expanding
  16. a macro when a macro is invoked. Here is a list for things to consider
  17. when using VMD with VC++:
  18. * The BOOST_VMD_IS_EMPTY macro will expand erroneously to 1 if the input resolves
  19. to a function-like macro name, which when it is called with an empty parameter
  20. expands to a tuple.
  21. * The BOOST_VMD_ASSERT macro, and the corresponding individual VMD ASSERT macros
  22. for the various data types, do not cause an immediate compiler error, but instead
  23. generate invalid C++ if the ASSERT occurs.
  24. * When the BOOST_VMD_ASSERT macro, or one of the corresponding individual VMD ASSERT macros
  25. for the various data types, does not generate an error, and the macro in which it is
  26. being used does generate some output, it is necessary to use BOOST_PP_CAT to
  27. concatenate the empty result of the VMD ASSERT macro with the normally generated output
  28. to correctly generate the final expansion of the macro in which the VMD ASSERT occurs.
  29. * When using BOOST_VMD_EMPTY following some non-empty expansion, or when using
  30. BOOST_VMD_IDENTITY, the value returned needs to be concatenated using BOOST_PP_CAT
  31. with an empty value. You can use BOOST_VMD_IDENTITY_RESULT to accomplish this
  32. transparently.
  33. * Avoid using an empty parenthesis to pass no data as a tuple or seq if VC++8 might
  34. be used as the compiler.
  35. [endsect]