• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<html>
2<head>
3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
4<title>Visual C++ gotchas in VMD</title>
5<link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css">
6<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
7<link rel="home" href="../index.html" title="Chapter 1. The Variadic Macro Data Library 1.9">
8<link rel="up" href="../index.html" title="Chapter 1. The Variadic Macro Data Library 1.9">
9<link rel="prev" href="vmd_dynamic_typing.html" title="Input as dynamic types">
10<link rel="next" href="vmd_conv.html" title="Version 1.7 to 1.8 conversion">
11</head>
12<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
13<table cellpadding="2" width="100%"><tr>
14<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td>
15<td align="center"><a href="../../../../../index.html">Home</a></td>
16<td align="center"><a href="../../../../../libs/libraries.htm">Libraries</a></td>
17<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
18<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
19<td align="center"><a href="../../../../../more/index.htm">More</a></td>
20</tr></table>
21<hr>
22<div class="spirit-nav">
23<a accesskey="p" href="vmd_dynamic_typing.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="vmd_conv.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
24</div>
25<div class="section">
26<div class="titlepage"><div><div><h2 class="title" style="clear: both">
27<a name="variadic_macro_data.vmd_vc_isms"></a><a class="link" href="vmd_vc_isms.html" title="Visual C++ gotchas in VMD">Visual C++ gotchas in
28    VMD</a>
29</h2></div></div></div>
30<p>
31      I have discussed throughout the documentation areas of VMD which need to be
32      considered when using Microsoft's Visual C++ compilers. The VMD library supports
33      VC++ versions 8 through the latest 14.2. These correspond to Visual Studio
34      2005 through the current Visual Studio 2019.
35    </p>
36<p>
37      I will give here fairly briefly the VC++ quirks which should be taken into
38      account when using VMD. These quirks exist because the VC++ compiler does not
39      have a C++ standard conforming preprocessor. More specifically the VC++ compiler
40      does not follow all of the rules correctly for expanding a macro when a macro
41      is invoked. Here is a list for things to consider when using VMD with VC++:
42    </p>
43<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
44<li class="listitem">
45          The BOOST_VMD_IS_EMPTY macro will expand erroneously to 1 if the input
46          resolves to a function-like macro name, which when it is called with an
47          empty parameter expands to a tuple.
48        </li>
49<li class="listitem">
50          The BOOST_VMD_ASSERT macro, and the corresponding individual VMD ASSERT
51          macros for the various data types, do not cause an immediate compiler error,
52          but instead generate invalid C++ if the ASSERT occurs.
53        </li>
54<li class="listitem">
55          When the BOOST_VMD_ASSERT macro, or one of the corresponding individual
56          VMD ASSERT macros for the various data types, does not generate an error,
57          and the macro in which it is being used does generate some output, it is
58          necessary to use BOOST_PP_CAT to concatenate the empty result of the VMD
59          ASSERT macro with the normally generated output to correctly generate the
60          final expansion of the macro in which the VMD ASSERT occurs.
61        </li>
62<li class="listitem">
63          When using BOOST_VMD_EMPTY following some non-empty expansion, or when
64          using BOOST_VMD_IDENTITY, the value returned needs to be concatenated using
65          BOOST_PP_CAT with an empty value. You can use BOOST_VMD_IDENTITY_RESULT
66          to accomplish this transparently.
67        </li>
68<li class="listitem">
69          Avoid using an empty parenthesis to pass no data as a tuple or seq if VC++8
70          might be used as the compiler.
71        </li>
72</ul></div>
73</div>
74<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
75<td align="left"></td>
76<td align="right"><div class="copyright-footer">Copyright © 2010-2017 Tropic Software
77      East Inc</div></td>
78</tr></table>
79<hr>
80<div class="spirit-nav">
81<a accesskey="p" href="vmd_dynamic_typing.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="vmd_conv.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
82</div>
83</body>
84</html>
85