]>
Commit | Line | Data |
---|---|---|
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 | ||
8 | [section:vmd_vc_isms Visual C++ gotchas in VMD] | |
9 | ||
10 | I have discussed throughout the documentation areas of VMD which need to be | |
11 | considered when using Microsoft's Visual C++ compilers. The VMD library | |
12 | supports VC++ versions 8 through the latest 14. These correspond to | |
13 | Visual Studio 2005 through the current Visual Studio 2015. | |
14 | ||
15 | I will give here fairly briefly the VC++ quirks which should be taken | |
16 | into account when using VMD. These quirks exist because the VC++ compiler | |
17 | does not have a C++ standard conforming preprocessor. More specifically | |
18 | the VC++ compiler does not follow all of the rules correctly for expanding | |
19 | a macro when a macro is invoked. Here is a list for things to consider | |
20 | when using VMD with VC++: | |
21 | ||
22 | * The BOOST_VMD_IS_EMPTY macro will expand erroneously to 1 if the input resolves | |
23 | to a function-like macro name, which when it is called with an empty parameter | |
24 | expands to a tuple. | |
25 | ||
26 | * The BOOST_VMD_ASSERT macro, and the corresponding individual VMD ASSERT macros | |
27 | for the various data types, do not cause an immediate compiler error, but instead | |
28 | generate invalid C++ if the ASSERT occurs. | |
29 | ||
30 | * When the BOOST_VMD_ASSERT macro, or one of the corresponding individual VMD ASSERT macros | |
31 | for the various data types, does not generate an error, and the macro in which it is | |
32 | being used does generate some output, it is necessary to use BOOST_PP_CAT to | |
33 | concatenate the empty result of the VMD ASSERT macro with the normally generated output | |
34 | to correctly generate the final expansion of the macro in which the VMD ASSERT occurs. | |
35 | ||
36 | * When using BOOST_VMD_EMPTY following some non-empty expansion, or when using | |
37 | BOOST_VMD_IDENTITY, the value returned needs to be concatenated using BOOST_PP_CAT | |
38 | with an empty value. You can use BOOST_VMD_IDENTITY_RESULT to accomplish this | |
39 | transparently. | |
40 | ||
41 | * Avoid using an empty parenthesis to pass no data as a tuple or seq if VC++8 might | |
42 | be used as the compiler. | |
43 | ||
44 | [endsect] |