forked from boostorg/preprocessor
Documentation for variadic opt functionality.
This commit is contained in:
@ -230,6 +230,7 @@
|
|||||||
<li><a href="headers/variadic.html">variadic.hpp</a></li>
|
<li><a href="headers/variadic.html">variadic.hpp</a></li>
|
||||||
<li>variadic/</li>
|
<li>variadic/</li>
|
||||||
<li class="ps"><a href="headers/variadic/elem.html">elem.hpp</a> <a href="topics/variadic_macros.html#VNotation">(v)</a></li>
|
<li class="ps"><a href="headers/variadic/elem.html">elem.hpp</a> <a href="topics/variadic_macros.html#VNotation">(v)</a></li>
|
||||||
|
<li class="ps"><a href="headers/variadic/opt.html">opt.hpp</a> </li>
|
||||||
<li class="ps"><a href="headers/variadic/size.html">size.hpp</a> <a href="topics/variadic_macros.html#VNotation">(v)</a></li>
|
<li class="ps"><a href="headers/variadic/size.html">size.hpp</a> <a href="topics/variadic_macros.html#VNotation">(v)</a></li>
|
||||||
<li class="ps"><a href="headers/variadic/to_array.html">to_array.hpp</a> <a
|
<li class="ps"><a href="headers/variadic/to_array.html">to_array.hpp</a> <a
|
||||||
href="topics/variadic_macros.html#VNotation">(v)</a></li>
|
href="topics/variadic_macros.html#VNotation">(v)</a></li>
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
<h4>Includes</h4>
|
<h4>Includes</h4>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="variadic/elem.html"><boost/preprocessor/variadic/elem.hpp></a> <a href="../topics/variadic_macros.html#VNotation" target="_self">(v)</a></li>
|
<li><a href="variadic/elem.html"><boost/preprocessor/variadic/elem.hpp></a> <a href="../topics/variadic_macros.html#VNotation" target="_self">(v)</a></li>
|
||||||
|
<li><a href="variadic/opt.html"><boost/preprocessor/variadic/opt.hpp></a> </li>
|
||||||
<li><a href="variadic/size.html"><boost/preprocessor/variadic/size.hpp></a> <a href="../topics/variadic_macros.html#VNotation" target="_self">(v)</a></li>
|
<li><a href="variadic/size.html"><boost/preprocessor/variadic/size.hpp></a> <a href="../topics/variadic_macros.html#VNotation" target="_self">(v)</a></li>
|
||||||
<li><a href="variadic/to_array.html"><boost/preprocessor/variadic/to_array.hpp></a> <a href="../topics/variadic_macros.html#VNotation" target="_self">(v)</a></li>
|
<li><a href="variadic/to_array.html"><boost/preprocessor/variadic/to_array.hpp></a> <a href="../topics/variadic_macros.html#VNotation" target="_self">(v)</a></li>
|
||||||
<li><a href="variadic/to_list.html"><boost/preprocessor/variadic/to_list.hpp></a> <a href="../topics/variadic_macros.html#VNotation" target="_self">(v)</a></li>
|
<li><a href="variadic/to_list.html"><boost/preprocessor/variadic/to_list.hpp></a> <a href="../topics/variadic_macros.html#VNotation" target="_self">(v)</a></li>
|
||||||
@ -22,7 +23,7 @@
|
|||||||
</ul>
|
</ul>
|
||||||
<hr size="1">
|
<hr size="1">
|
||||||
<div style="margin-left: 0px;">
|
<div style="margin-left: 0px;">
|
||||||
<i></i><i><EFBFBD> Copyright Edward Diener 2011,2013</i>
|
<i></i><i><EFBFBD> Copyright Edward Diener 2011,2013,2019</i>
|
||||||
</div>
|
</div>
|
||||||
<div style="margin-left: 0px;">
|
<div style="margin-left: 0px;">
|
||||||
<p><small>Distributed under the Boost Software License, Version 1.0. (See
|
<p><small>Distributed under the Boost Software License, Version 1.0. (See
|
||||||
|
25
doc/headers/variadic/opt.html
Normal file
25
doc/headers/variadic/opt.html
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
<html><head>
|
||||||
|
<title>variadic/opt.hpp</title>
|
||||||
|
<link rel="stylesheet" type="text/css" href="../../styles.css"></head><body>
|
||||||
|
<div style="margin-left: 0px;">
|
||||||
|
The <b>variadic/opt.hpp</b> header defines a macro that determines whether or not the __VA_OPT__ construct is supported.
|
||||||
|
</div>
|
||||||
|
<h4>Usage</h4>
|
||||||
|
<div class="code">
|
||||||
|
#include <b><boost/preprocessor/variadic/opt.hpp></b>
|
||||||
|
</div>
|
||||||
|
<h4>Contents</h4>
|
||||||
|
<ul>
|
||||||
|
<li><a href="../../ref/variadic_opt.html">BOOST_PP_VARIADIC_OPT</a> <br>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<hr size="1">
|
||||||
|
<div style="margin-left: 0px;">
|
||||||
|
<i></i><i><EFBFBD> Copyright Edward Diener 2019</i>
|
||||||
|
</div>
|
||||||
|
<div style="margin-left: 0px;">
|
||||||
|
<p><small>Distributed under the Boost Software License, Version 1.0. (See
|
||||||
|
accompanying file <a href="../../../../../LICENSE_1_0.txt">LICENSE_1_0.txt</a> or
|
||||||
|
copy at <a href="http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt</a>)</small></p>
|
||||||
|
</div>
|
||||||
|
</body></html>
|
@ -298,6 +298,7 @@
|
|||||||
<li><a href="ref/value.html">VALUE</a></li>
|
<li><a href="ref/value.html">VALUE</a></li>
|
||||||
<li><a href="ref/variadics.html">VARIADICS</a></li>
|
<li><a href="ref/variadics.html">VARIADICS</a></li>
|
||||||
<li><a href="ref/variadic_elem.html">VARIADIC_ELEM</a> <a href="topics/variadic_macros.html#VNotation">(v)</a></li>
|
<li><a href="ref/variadic_elem.html">VARIADIC_ELEM</a> <a href="topics/variadic_macros.html#VNotation">(v)</a></li>
|
||||||
|
<li><a href="ref/variadic_opt.html">VARIADIC_OPT</a></li>
|
||||||
<li><a href="ref/variadic_seq_to_seq.html">VARIADIC_SEQ_TO_SEQ</a> <a href="topics/variadic_macros.html#VNotation">(v)</a></li>
|
<li><a href="ref/variadic_seq_to_seq.html">VARIADIC_SEQ_TO_SEQ</a> <a href="topics/variadic_macros.html#VNotation">(v)</a></li>
|
||||||
<li><a href="ref/variadic_size.html">VARIADIC_SIZE</a> <a href="topics/variadic_macros.html#VNotation">(v)</a></li>
|
<li><a href="ref/variadic_size.html">VARIADIC_SIZE</a> <a href="topics/variadic_macros.html#VNotation">(v)</a></li>
|
||||||
<li><a href="ref/variadic_to_array.html">VARIADIC_TO_ARRAY</a> <a href="topics/variadic_macros.html#VNotation">(v)</a></li>
|
<li><a href="ref/variadic_to_array.html">VARIADIC_TO_ARRAY</a> <a href="topics/variadic_macros.html#VNotation">(v)</a></li>
|
||||||
|
41
doc/ref/variadic_opt.html
Normal file
41
doc/ref/variadic_opt.html
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>BOOST_PP_VARIADIC_OPT</title>
|
||||||
|
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div style="margin-left: 0px;"> The <b>BOOST_PP_VARIADIC_OPT</b> macro
|
||||||
|
determines whether or not the C++20 __VA_OPT__ construct is supported for the compiler's preprocessor being used.
|
||||||
|
Expands to 1 if the __VA_OPT__ construct is supported, otherwise expands to 0.
|
||||||
|
</div>
|
||||||
|
<h4>Usage</h4>
|
||||||
|
<div class="code"> <b>BOOST_PP_VARIADIC_OPT</b>() <br>
|
||||||
|
</div>
|
||||||
|
<h4>Arguments</h4>
|
||||||
|
<dl>
|
||||||
|
<dt>None<br>
|
||||||
|
</dt>
|
||||||
|
</dl>
|
||||||
|
<h4>Requirements</h4>
|
||||||
|
<div> <b>Header:</b> <a href="../headers/variadic/opt.html"><boost/preprocessor/variadic/opt.hpp></a>
|
||||||
|
</div>
|
||||||
|
<h4>Sample Code</h4>
|
||||||
|
<div>
|
||||||
|
<pre>
|
||||||
|
#include <<a href="../headers/variadic/opt.html">boost/preprocessor/variadic/opt.hpp</a>><br>
|
||||||
|
#if <a href="variadic_opt.html">BOOST_PP_VARIADIC_OPT</a>()<br>
|
||||||
|
// Preprocessor code which uses __VA_OPT__<br>
|
||||||
|
#else<br>
|
||||||
|
// Preprocessor code which does not use __VA_OPT__<br>
|
||||||
|
#endif<br>
|
||||||
|
</pre>
|
||||||
|
</div>
|
||||||
|
<hr size="1">
|
||||||
|
<div style="margin-left: 0px;"> <i></i><i><EFBFBD> Copyright Edward Diener 2019</i> </div>
|
||||||
|
<div style="margin-left: 0px;">
|
||||||
|
<p><small>Distributed under the Boost Software License, Version 1.0.
|
||||||
|
(See accompanying file <a href="../../../../LICENSE_1_0.txt">LICENSE_1_0.txt</a>
|
||||||
|
or copy at <a href="http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt</a>)</small></p>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -284,6 +284,7 @@
|
|||||||
<!-- V -->
|
<!-- V -->
|
||||||
<br>BOOST_PP_VALUE
|
<br>BOOST_PP_VALUE
|
||||||
<br>BOOST_PP_VARIADIC_ELEM
|
<br>BOOST_PP_VARIADIC_ELEM
|
||||||
|
<br>BOOST_PP_VARIADIC_OPT
|
||||||
<br>BOOST_PP_VARIADIC_SIZE
|
<br>BOOST_PP_VARIADIC_SIZE
|
||||||
<br>BOOST_PP_VARIADIC_TO_ARRAY
|
<br>BOOST_PP_VARIADIC_TO_ARRAY
|
||||||
<br>BOOST_PP_VARIADIC_TO_LIST
|
<br>BOOST_PP_VARIADIC_TO_LIST
|
||||||
|
@ -136,6 +136,27 @@
|
|||||||
use this variadic data reliably as arguments to other macros, one needs
|
use this variadic data reliably as arguments to other macros, one needs
|
||||||
variadic macro support.<br>
|
variadic macro support.<br>
|
||||||
</div>
|
</div>
|
||||||
|
<h4>C++20 Support For Variadic Macros</h4>
|
||||||
|
<div>
|
||||||
|
In the C++20 specification there is a new construct which can be
|
||||||
|
used in the expansion of a variadic macro, called __VA_OPT__. This
|
||||||
|
construct when used in the expansion of a variadic macro is followed
|
||||||
|
by an opening paranthesis ('('), preprocessor data, and a closing
|
||||||
|
parenthesis ('}'). When the variadic data passed by the invocation
|
||||||
|
of a variadic macro is empty, this new construct expands to nothing.
|
||||||
|
When the variadic data passed by the invocation of a variadic macro
|
||||||
|
is not empty, this new construct expands to the preprocessor data
|
||||||
|
between its opening and closing parentheses.
|
||||||
|
<br><br>
|
||||||
|
This library offers support for this new C++20 construct by automatically
|
||||||
|
detecting whether this new construct is supported by the compiler's
|
||||||
|
preprocessor when using the library. The library macro which detects
|
||||||
|
support for the __VA_OPT__ construct is called BOOST_PP_VARIADIC_OPT.
|
||||||
|
This is a function-like macro which takes no parameters and returns
|
||||||
|
1 if the compiler is working in C++20 mode and supports the __VA_OPT__
|
||||||
|
construct, while otherwise it returns 0.
|
||||||
|
<br>
|
||||||
|
</div>
|
||||||
<u style="font-weight: bold;"> Using a Tuple Instead of an Array<br>
|
<u style="font-weight: bold;"> Using a Tuple Instead of an Array<br>
|
||||||
</u>
|
</u>
|
||||||
<div>An array as a preprocessor data type is a two-element tuple where the
|
<div>An array as a preprocessor data type is a two-element tuple where the
|
||||||
@ -257,6 +278,5 @@
|
|||||||
(See accompanying file <a href="../../../../LICENSE_1_0.txt">LICENSE_1_0.txt</a>
|
(See accompanying file <a href="../../../../LICENSE_1_0.txt">LICENSE_1_0.txt</a>
|
||||||
or copy at <a href="http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt</a>)</small></p>
|
or copy at <a href="http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt</a>)</small></p>
|
||||||
</div>
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
</body></html>
|
|
@ -14,6 +14,7 @@
|
|||||||
# define BOOST_PREPROCESSOR_VARIADIC_HPP
|
# define BOOST_PREPROCESSOR_VARIADIC_HPP
|
||||||
#
|
#
|
||||||
# include <boost/preprocessor/variadic/elem.hpp>
|
# include <boost/preprocessor/variadic/elem.hpp>
|
||||||
|
# include <boost/preprocessor/variadic/opt.hpp>
|
||||||
# include <boost/preprocessor/variadic/size.hpp>
|
# include <boost/preprocessor/variadic/size.hpp>
|
||||||
# include <boost/preprocessor/variadic/to_array.hpp>
|
# include <boost/preprocessor/variadic/to_array.hpp>
|
||||||
# include <boost/preprocessor/variadic/to_list.hpp>
|
# include <boost/preprocessor/variadic/to_list.hpp>
|
||||||
|
Reference in New Issue
Block a user