forked from boostorg/preprocessor
51 lines
1.8 KiB
HTML
51 lines
1.8 KiB
HTML
<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>()
|
|
// Preprocessor code which uses __VA_OPT__
|
|
#else
|
|
// Preprocessor code which does not use __VA_OPT__
|
|
#endif
|
|
</pre>
|
|
<br>
|
|
or within a macro definition<br><br>
|
|
<pre>
|
|
#include <boost/preprocessor/control/iif.hpp>
|
|
#include <<a href="../headers/variadic/opt.html">boost/preprocessor/variadic/opt.hpp</a>><br>
|
|
#define USE_OPT(...) BOOST_PP_IIF(<a href="variadic_opt.html">BOOST_PP_VARIADIC_OPT</a>(),MACRO_USING_OPT,MACRO_NOT_USING_OPT)(__VA_ARGS__)
|
|
#define MACRO_USING_OPT(...) __VA_OPT__( preprocessor tokens ) anything
|
|
#define MACRO_NOT_USING_OPT(...) anything
|
|
</pre>
|
|
</div>
|
|
<hr size="1">
|
|
<div style="margin-left: 0px;"> <i></i><i>© 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>
|