Changed name of macro from BOOST_PP_VARIADIC_OPT to BOOST_PP_VARIADIC_HAS_OPT

This commit is contained in:
Edward Diener
2019-10-19 05:49:13 -04:00
parent 771edacbff
commit 1473215dc7
16 changed files with 36 additions and 36 deletions

View File

@ -10,7 +10,7 @@
</div> </div>
<h4>Contents</h4> <h4>Contents</h4>
<ul> <ul>
<li><a href="../../ref/variadic_opt.html">BOOST_PP_VARIADIC_OPT</a> <br> <li><a href="../../ref/variadic_opt.html">BOOST_PP_VARIADIC_HAS_OPT</a> <br>
</li> </li>
</ul> </ul>
<hr size="1"> <hr size="1">

View File

@ -299,7 +299,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_opt.html">VARIADIC_HAS_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>

View File

@ -19,17 +19,17 @@ the compilation is at the C++20 level and the __VA_OPT__ construct is supported.
</dl> </dl>
<h4>Remarks</h4> <h4>Remarks</h4>
<div> <div>
When the macro invocation BOOST_PP_VARIADIC_OPT() expands to 1, then this When the macro invocation BOOST_PP_VARIADIC_HAS_OPT() expands to 1, then this
macro exists and can be invoked, otherwise this macro does not exist macro exists and can be invoked, otherwise this macro does not exist
and attempting to invoke it will lead to a preprocessor error that the macro and attempting to invoke it will lead to a preprocessor error that the macro
can not be found. Because of this condition the header file for including can not be found. Because of this condition the header file for including
this macro includes the header file for the BOOST_PP_VARIADIC_OPT macro.<br> this macro includes the header file for the BOOST_PP_VARIADIC_HAS_OPT macro.<br>
It is possible to pass data to this macro which expands to nothing, in which It is possible to pass data to this macro which expands to nothing, in which
case this macro will expand to 1 just as if nothing has been passed. case this macro will expand to 1 just as if nothing has been passed.
</div> </div>
<h4>See Also</h4> <h4>See Also</h4>
<ul> <ul>
<li><a href="variadic_opt.html">BOOST_PP_VARIADIC_OPT</a></li> <li><a href="variadic_opt.html">BOOST_PP_VARIADIC_HAS_OPT</a></li>
</ul> </ul>
<h4>Requirements</h4> <h4>Requirements</h4>
<div> <b>Header:</b> &nbsp;<a href="../headers/facilities/check_empty.html">&lt;boost/preprocessor/facilities/check_empty.hpp&gt;</a> <div> <b>Header:</b> &nbsp;<a href="../headers/facilities/check_empty.html">&lt;boost/preprocessor/facilities/check_empty.hpp&gt;</a>
@ -39,7 +39,7 @@ case this macro will expand to 1 just as if nothing has been passed.
<pre> <pre>
#include &lt;<a href="../headers/facilities/check_empty.html">boost/preprocessor/facilities/check_empty.hpp</a>&gt; #include &lt;<a href="../headers/facilities/check_empty.html">boost/preprocessor/facilities/check_empty.hpp</a>&gt;
# if <a href="variadic_opt.html">BOOST_PP_VARIADIC_OPT</a>() # if <a href="variadic_opt.html">BOOST_PP_VARIADIC_HAS_OPT</a>()
#define DATA #define DATA
#define OBJECT OBJECT2 #define OBJECT OBJECT2

View File

@ -1,15 +1,15 @@
<html> <html>
<head> <head>
<title>BOOST_PP_VARIADIC_OPT</title> <title>BOOST_PP_VARIADIC_HAS_OPT</title>
<link rel="stylesheet" type="text/css" href="../styles.css"> <link rel="stylesheet" type="text/css" href="../styles.css">
</head> </head>
<body> <body>
<div style="margin-left: 0px;"> The <b>BOOST_PP_VARIADIC_OPT</b> macro <div style="margin-left: 0px;"> The <b>BOOST_PP_VARIADIC_HAS_OPT</b> macro
determines whether or not the C++20 __VA_OPT__ construct is supported for the compiler's preprocessor being used. 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. Expands to 1 if the __VA_OPT__ construct is supported, otherwise expands to 0.
</div> </div>
<h4>Usage</h4> <h4>Usage</h4>
<div class="code"> <b>BOOST_PP_VARIADIC_OPT</b>() <br> <div class="code"> <b>BOOST_PP_VARIADIC_HAS_OPT</b>() <br>
</div> </div>
<h4>Arguments</h4> <h4>Arguments</h4>
<dl> <dl>
@ -36,7 +36,7 @@ Expands to 1 if the __VA_OPT__ construct is supported, otherwise expands to 0.
<div> <div>
<pre> <pre>
#include &lt;<a href="../headers/variadic/opt.html">boost/preprocessor/variadic/opt.hpp</a>&gt;<br> #include &lt;<a href="../headers/variadic/opt.html">boost/preprocessor/variadic/opt.hpp</a>&gt;<br>
#if <a href="variadic_opt.html">BOOST_PP_VARIADIC_OPT</a>() #if <a href="variadic_opt.html">BOOST_PP_VARIADIC_HAS_OPT</a>()
// Preprocessor code which uses __VA_OPT__ // Preprocessor code which uses __VA_OPT__
#else #else
// Preprocessor code which does not use __VA_OPT__ // Preprocessor code which does not use __VA_OPT__
@ -47,7 +47,7 @@ or within a macro definition<br><br>
<pre> <pre>
#include &lt;boost/preprocessor/control/iif.hpp&gt; #include &lt;boost/preprocessor/control/iif.hpp&gt;
#include &lt;<a href="../headers/variadic/opt.html">boost/preprocessor/variadic/opt.hpp</a>&gt;<br> #include &lt;<a href="../headers/variadic/opt.html">boost/preprocessor/variadic/opt.hpp</a>&gt;<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 USE_OPT(...) BOOST_PP_IIF(<a href="variadic_opt.html">BOOST_PP_VARIADIC_HAS_OPT</a>(),MACRO_USING_OPT,MACRO_NOT_USING_OPT)(__VA_ARGS__)
#define MACRO_USING_OPT(...) __VA_OPT__( preprocessor tokens ) anything #define MACRO_USING_OPT(...) __VA_OPT__( preprocessor tokens ) anything
#define MACRO_NOT_USING_OPT(...) anything #define MACRO_NOT_USING_OPT(...) anything
</pre> </pre>

View File

@ -284,7 +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_HAS_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

View File

@ -98,7 +98,7 @@
not publicly appeared. This library uses that code to test for __VA_OPT__ as a necessary prelude not publicly appeared. This library uses that code to test for __VA_OPT__ as a necessary prelude
for creating a variadic macro which is 100% reliable in testing for emptiness.<br><br> for creating a variadic macro which is 100% reliable in testing for emptiness.<br><br>
The Boost Preprocessor macro for testing whether the __VA_OPT__ construct is supported during The Boost Preprocessor macro for testing whether the __VA_OPT__ construct is supported during
compilation is called BOOST_PP_VARIADIC_OPT, which is a function-like macro taking no parameters compilation is called BOOST_PP_VARIADIC_HAS_OPT, which is a function-like macro taking no parameters
and returning 1 if the __VA_OPT__ construct is supported and 0 if it is not. The macro and returning 1 if the __VA_OPT__ construct is supported and 0 if it is not. The macro
only returns 1 when variadic macros are supported, when the compiler is at the C++20 level, only returns 1 when variadic macros are supported, when the compiler is at the C++20 level,
and when the __VA_OPT__ construct can be used according to the C++20 standard. In particular and when the __VA_OPT__ construct can be used according to the C++20 standard. In particular
@ -109,13 +109,13 @@
can produce a warning, or even an error, when it even sees a macro using the __VA_OPT__ can produce a warning, or even an error, when it even sees a macro using the __VA_OPT__
construct at a level below C++20, even though it supports it, if other compiler options construct at a level below C++20, even though it supports it, if other compiler options
requiring strict adherence to the level of the C++ standard being used are passed on the requiring strict adherence to the level of the C++ standard being used are passed on the
command line. So taking a conservative approach the BOOST_PP_VARIADIC_OPT macros requires command line. So taking a conservative approach the BOOST_PP_VARIADIC_HAS_OPT macros requires
compilation at the C++20 level, along with variadic macro support, along with the testing code compilation at the C++20 level, along with variadic macro support, along with the testing code
expanding to 1, in order to specify that __VA_OPT__ is supported.<br><br> expanding to 1, in order to specify that __VA_OPT__ is supported.<br><br>
The actual Boost Preprocessor library for testing for emptiness in C++20 mode is called The actual Boost Preprocessor library for testing for emptiness in C++20 mode is called
BOOST_PP_CHECK_EMPTY. The macro is a variadic macro with a single variadic parameter. The BOOST_PP_CHECK_EMPTY. The macro is a variadic macro with a single variadic parameter. The
macro only exists if our previous macro for testing for __VA_OPT__ called BOOST_PP_VARIADIC_OPT macro only exists if our previous macro for testing for __VA_OPT__ called BOOST_PP_VARIADIC_HAS_OPT
expands to 1 when invoked as BOOST_PP_VARIADIC_OPT(). If BOOST_PP_VARIADIC_OPT() expands to 0 expands to 1 when invoked as BOOST_PP_VARIADIC_HAS_OPT(). If BOOST_PP_VARIADIC_HAS_OPT() expands to 0
the BOOST_PP_CHECK_EMPTY macro does not exist at all in this library. The input to the macro the BOOST_PP_CHECK_EMPTY macro does not exist at all in this library. The input to the macro
can be any variadic data. If the data passed to the macro is empty, or if the data passed to can be any variadic data. If the data passed to the macro is empty, or if the data passed to
the macro is not empty but when the data itself is expanded it is empty, the macro returns the macro is not empty but when the data itself is expanded it is empty, the macro returns
@ -135,7 +135,7 @@
</div> </div>
<b>See</b> <b>Also</b><br> <b>See</b> <b>Also</b><br>
<ul> <ul>
<li><a href="../ref/variadic_opt.html">BOOST_PP_VARIADIC_OPT</a></li> <li><a href="../ref/variadic_opt.html">BOOST_PP_VARIADIC_HAS_OPT</a></li>
<li><a href="../ref/check_empty.html">BOOST_PP_CHECK_EMPTY</a></li> <li><a href="../ref/check_empty.html">BOOST_PP_CHECK_EMPTY</a></li>
</ul> </ul>
<hr size="1"> <hr size="1">

View File

@ -151,7 +151,7 @@
This library offers support for this new C++20 construct by automatically This library offers support for this new C++20 construct by automatically
detecting whether this new construct is supported by the compiler's detecting whether this new construct is supported by the compiler's
preprocessor when using the library. The library macro which detects preprocessor when using the library. The library macro which detects
support for the __VA_OPT__ construct is called BOOST_PP_VARIADIC_OPT. support for the __VA_OPT__ construct is called BOOST_PP_VARIADIC_HAS_OPT.
This is a function-like macro which takes no parameters and returns 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__ 1 if the compiler is working in C++20 mode and supports the __VA_OPT__
construct, while otherwise it returns 0. construct, while otherwise it returns 0.

View File

@ -12,8 +12,8 @@
# ifndef BOOST_PREPROCESSOR_FACILITIES_CHECK_EMPTY_HPP # ifndef BOOST_PREPROCESSOR_FACILITIES_CHECK_EMPTY_HPP
# define BOOST_PREPROCESSOR_FACILITIES_CHECK_EMPTY_HPP # define BOOST_PREPROCESSOR_FACILITIES_CHECK_EMPTY_HPP
# include <boost/preprocessor/variadic/opt.hpp> # include <boost/preprocessor/variadic/opt.hpp>
# if BOOST_PP_VARIADIC_OPT() # if BOOST_PP_VARIADIC_HAS_OPT()
# include <boost/preprocessor/facilities/is_empty_variadic.hpp> # include <boost/preprocessor/facilities/is_empty_variadic.hpp>
# define BOOST_PP_CHECK_EMPTY(...) BOOST_PP_IS_EMPTY_OPT(__VA_ARGS__) # define BOOST_PP_CHECK_EMPTY(...) BOOST_PP_IS_EMPTY_OPT(__VA_ARGS__)
# endif /* BOOST_PP_VARIADIC_OPT() */ # endif /* BOOST_PP_VARIADIC_HAS_OPT() */
# endif /* BOOST_PREPROCESSOR_FACILITIES_CHECK_EMPTY_HPP */ # endif /* BOOST_PREPROCESSOR_FACILITIES_CHECK_EMPTY_HPP */

View File

@ -42,7 +42,7 @@
#define BOOST_PP_IS_EMPTY(...) \ #define BOOST_PP_IS_EMPTY(...) \
BOOST_PP_DETAIL_IS_EMPTY_IIF \ BOOST_PP_DETAIL_IS_EMPTY_IIF \
( \ ( \
BOOST_PP_VARIADIC_OPT() \ BOOST_PP_VARIADIC_HAS_OPT() \
) \ ) \
( \ ( \
BOOST_PP_IS_EMPTY_OPT, \ BOOST_PP_IS_EMPTY_OPT, \
@ -57,7 +57,7 @@
BOOST_PP_IS_EMPTY_FUNCTION2(__VA_ARGS__) \ BOOST_PP_IS_EMPTY_FUNCTION2(__VA_ARGS__) \
/**/ /**/
#define BOOST_PP_IS_EMPTY_OPT(...) \ #define BOOST_PP_IS_EMPTY_OPT(...) \
BOOST_PP_VARIADIC_OPT_ELEM0(BOOST_PP_IS_EMPTY_FUNCTION(__VA_ARGS__),) \ BOOST_PP_VARIADIC_HAS_OPT_ELEM0(BOOST_PP_IS_EMPTY_FUNCTION(__VA_ARGS__),) \
/**/ /**/
# else # else
#define BOOST_PP_IS_EMPTY(...) \ #define BOOST_PP_IS_EMPTY(...) \

View File

@ -16,14 +16,14 @@
# #
# if BOOST_PP_VARIADICS && defined(__cplusplus) && __cplusplus > 201703L # if BOOST_PP_VARIADICS && defined(__cplusplus) && __cplusplus > 201703L
# #
# define BOOST_PP_VARIADIC_OPT_FUNCTION(...) \ # define BOOST_PP_VARIADIC_HAS_OPT_FUNCTION(...) \
__VA_OPT__(,) , 1, 0 \ __VA_OPT__(,) , 1, 0 \
/**/ /**/
# #
# define BOOST_PP_VARIADIC_OPT_ELEM0(e0, ...) BOOST_PP_VARIADIC_OPT_ELEM_0(e0,__VA_ARGS__) # define BOOST_PP_VARIADIC_HAS_OPT_ELEM0(e0, ...) BOOST_PP_VARIADIC_HAS_OPT_ELEM_0(e0,__VA_ARGS__)
# define BOOST_PP_VARIADIC_OPT_ELEM2(e0, ...) BOOST_PP_VARIADIC_OPT_ELEM_2(e0,__VA_ARGS__) # define BOOST_PP_VARIADIC_HAS_OPT_ELEM2(e0, ...) BOOST_PP_VARIADIC_HAS_OPT_ELEM_2(e0,__VA_ARGS__)
# define BOOST_PP_VARIADIC_OPT_ELEM_0(e0, ...) e0 # define BOOST_PP_VARIADIC_HAS_OPT_ELEM_0(e0, ...) e0
# define BOOST_PP_VARIADIC_OPT_ELEM_2(e0, e1, e2, ...) e2 # define BOOST_PP_VARIADIC_HAS_OPT_ELEM_2(e0, e1, e2, ...) e2
# #
# endif # endif
# #

View File

@ -14,15 +14,15 @@
# #
# include <boost/preprocessor/config/config.hpp> # include <boost/preprocessor/config/config.hpp>
# #
# /* BOOST_PP_VARIADIC_OPT */ # /* BOOST_PP_VARIADIC_HAS_OPT */
# #
# if BOOST_PP_VARIADICS && defined(__cplusplus) && __cplusplus > 201703L # if BOOST_PP_VARIADICS && defined(__cplusplus) && __cplusplus > 201703L
# include <boost/preprocessor/variadic/detail/opt.hpp> # include <boost/preprocessor/variadic/detail/opt.hpp>
# define BOOST_PP_VARIADIC_OPT() \ # define BOOST_PP_VARIADIC_HAS_OPT() \
BOOST_PP_VARIADIC_OPT_ELEM2(BOOST_PP_VARIADIC_OPT_FUNCTION(?),) \ BOOST_PP_VARIADIC_HAS_OPT_ELEM2(BOOST_PP_VARIADIC_HAS_OPT_FUNCTION(?),) \
/**/ /**/
# else # else
# define BOOST_PP_VARIADIC_OPT() 0 # define BOOST_PP_VARIADIC_HAS_OPT() 0
# endif # endif
# #
# endif # endif

View File

@ -12,7 +12,7 @@
# include <libs/preprocessor/test/test.h> # include <libs/preprocessor/test/test.h>
# include <boost/preprocessor/facilities/check_empty.hpp> # include <boost/preprocessor/facilities/check_empty.hpp>
# if BOOST_PP_VARIADIC_OPT() # if BOOST_PP_VARIADIC_HAS_OPT()
# include <boost/preprocessor/facilities/empty.hpp> # include <boost/preprocessor/facilities/empty.hpp>

View File

@ -94,7 +94,7 @@ void print_macros()
PRINT_MACRO(BOOST_PP_CONFIG_FLAGS()); PRINT_MACRO(BOOST_PP_CONFIG_FLAGS());
PRINT_MACRO(BOOST_PP_VARIADICS); PRINT_MACRO(BOOST_PP_VARIADICS);
PRINT_MACRO(BOOST_PP_VARIADICS_MSVC); PRINT_MACRO(BOOST_PP_VARIADICS_MSVC);
PRINT_MACRO(BOOST_PP_VARIADIC_OPT()); PRINT_MACRO(BOOST_PP_VARIADIC_HAS_OPT());
} }
int main() int main()

View File

@ -40,7 +40,7 @@
# include <boost/preprocessor/variadic/opt.hpp> # include <boost/preprocessor/variadic/opt.hpp>
#if defined(__cplusplus) && __cplusplus > 201703L && BOOST_PP_VARIADIC_OPT() #if defined(__cplusplus) && __cplusplus > 201703L && BOOST_PP_VARIADIC_HAS_OPT()
BEGIN BOOST_PP_IS_EMPTY(FUNC_GEN) == 0 END BEGIN BOOST_PP_IS_EMPTY(FUNC_GEN) == 0 END
BEGIN BOOST_PP_IS_EMPTY(FUNC_GEN2) == 0 END BEGIN BOOST_PP_IS_EMPTY(FUNC_GEN2) == 0 END

View File

@ -20,7 +20,7 @@
# include <boost/preprocessor/variadic/opt.hpp> # include <boost/preprocessor/variadic/opt.hpp>
BEGIN BOOST_PP_IS_EMPTY(FUNC_GEN8) == BOOST_PP_VARIADIC_OPT() END BEGIN BOOST_PP_IS_EMPTY(FUNC_GEN8) == BOOST_PP_VARIADIC_HAS_OPT() END
#else #else

View File

@ -20,7 +20,7 @@
# include <boost/preprocessor/variadic/opt.hpp> # include <boost/preprocessor/variadic/opt.hpp>
BEGIN BOOST_PP_IS_EMPTY(FUNC_GEN9) == BOOST_PP_VARIADIC_OPT() END BEGIN BOOST_PP_IS_EMPTY(FUNC_GEN9) == BOOST_PP_VARIADIC_HAS_OPT() END
#else #else