[DEV] add v1.76.0

This commit is contained in:
2021-10-05 21:37:46 +02:00
parent a97e9ae7d4
commit d0115b733d
45133 changed files with 4744437 additions and 1026325 deletions

View File

@@ -1,11 +1,11 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Useful variadic macros not in Boost PP</title>
<link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../index.html" title="Chapter&#160;1.&#160;The Variadic Macro Data Library 1.9">
<link rel="up" href="../index.html" title="Chapter&#160;1.&#160;The Variadic Macro Data Library 1.9">
<link rel="home" href="../index.html" title="Chapter 1. The Variadic Macro Data Library 1.10">
<link rel="up" href="../index.html" title="Chapter 1. The Variadic Macro Data Library 1.10">
<link rel="prev" href="vmd_identifier_subtype.html" title="Identifier subtypes">
<link rel="next" href="vmd_useful/vmd_identity.html" title="Generating emptiness and identity">
</head>
@@ -85,27 +85,30 @@
always cause an immediate preprocessing error for conforming compilers.
</p>
<p>
Unfortunately VC++ will only produce a warning when the wrong number of arguments
are passed to a macro. Therefore the BOOST_PP_ASSERT macro does not produce
a preprocessing error using VC++. Amazingly enough there appears to be no
other way in which VC++ can be forced to issue a preprocessing error by invoking
a macro ( if you find one please tell me about it ). However one can create
invalid C++ as the output from a macro invocation which causes VC++ to produce
a compiler error when the VC++ compiler later encounters the construct.
Unfortunately VC++ with its default preprocessor will only produce a warning
when the wrong number of arguments are passed to a macro. Therefore the BOOST_PP_ASSERT
macro does not produce a preprocessing error using VC++ with its default
preprocessor. Amazingly enough there appears to be no other way in which
VC++ with its default preprocessor can be forced to issue a preprocessing
error by invoking a macro ( if you find one please tell me about it ). However
one can create invalid C++ as the output from a macro invocation which causes
VC++ to produce a compiler error when the VC++ compiler later encounters
the construct.
</p>
<p>
This is what the macro BOOST_VMD_ASSERT does. It takes the same conditional
argument as BOOST_PP_ASSERT and it calls BOOST_PP_ASSERT when not used with
VC++, otherwise if the condition is 0 it generates a compiler error by generating
invalid C++ when used with VC++. The compiler error is generated by producing
invalid C++ whose form is:
VC++ with its default preprocessor, otherwise if the condition is 0 it generates
a compiler error by generating invalid C++ when used with VC++ with its default
preprocessor. The compiler error is generated by producing invalid C++ whose
form is:
</p>
<pre class="programlisting"><span class="keyword">typedef</span> <span class="keyword">char</span> <span class="identifier">BOOST_VMD_ASSERT_ERROR</span><span class="special">[-</span><span class="number">1</span><span class="special">];</span>
</pre>
<p>
By passing a second optional argument, whose form is a preprocessing identifier,
to BOOST_VMD_ASSERT you can generate the invalid C++ for VC++, if the first
argument is 0, of the form:
to BOOST_VMD_ASSERT you can generate the invalid C++ for VC++ with its default
preprocessor, if the first argument is 0, of the form:
</p>
<pre class="programlisting"><span class="keyword">typedef</span> <span class="keyword">char</span> <span class="identifier">optional_argument</span><span class="special">[-</span><span class="number">1</span><span class="special">];</span>
</pre>
@@ -209,12 +212,12 @@
and VC++ </a>
</h5>
<p>
The VC++ compiler has a quirk when dealing with BOOST_VMD_ASSERT and the
data type assert macros. If you invoke one of the assert macros within another
macro which would normally generate output preprocessor tokens, it is necessary
when using VC++ to concatenate the result of the assert macro to whatever
other preprocessor data is being generated, even if the assert macro does
not generate an error.
The VC++ compiler with its default preprocessor has a quirk when dealing
with BOOST_VMD_ASSERT and the data type assert macros. If you invoke one
of the assert macros within another macro which would normally generate output
preprocessor tokens, it is necessary when using VC++ with its default preprocessor
to concatenate the result of the assert macro to whatever other preprocessor
data is being generated, even if the assert macro does not generate an error.
</p>
<p>
As a simple example let us suppose we have a macro expecting a tuple and
@@ -231,7 +234,7 @@
<span class="identifier">BOOST_PP_IIF</span><span class="special">(</span><span class="identifier">BOOST_PP_GREATER</span><span class="special">(</span><span class="identifier">BOOST_PP_TUPLE_SIZE</span><span class="special">(</span><span class="identifier">atuple</span><span class="special">),</span> <span class="number">2</span><span class="special">),</span><span class="number">1</span><span class="special">,</span><span class="number">0</span><span class="special">)</span>
</pre>
<p>
but for VC++ we must write
but for VC++ with its default preprocessor we must write
</p>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">preprocessor</span><span class="special">/</span><span class="identifier">cat</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">preprocessor</span><span class="special">/</span><span class="identifier">comparison</span><span class="special">/</span><span class="identifier">greater</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
@@ -247,15 +250,16 @@
<span class="special">)</span>
</pre>
<p>
VC++ does not work correctly in the first instance, erroneously getting confused
as far as compiler output is concerned. But by using BOOST_PP_CAT in the
second condition VC++ will work correctly with VMD assertions.
VC++ with its default preprocessor does not work correctly in the first instance,
erroneously getting confused as far as compiler output is concerned. But
by using BOOST_PP_CAT in the second condition VC++ with its default preprocessor
will work correctly with VMD assertions.
</p>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2010-2017 Tropic Software
<td align="right"><div class="copyright-footer">Copyright © 2010-2017 Tropic Software
East Inc</div></td>
</tr></table>
<hr>