forked from boostorg/preprocessor
Merge branch 'develop'
This commit is contained in:
@ -5,7 +5,7 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div style="margin-left: 0px;">
|
<div style="margin-left: 0px;">
|
||||||
The <b>facilities/identity.hpp</b> header defines a utility macro to use with <b>BOOST_PP_IF</b> and <b>BOOST_PP_IIF</b>.
|
The <b>facilities/identity.hpp</b> header defines utility macros to use with <b>BOOST_PP_IF</b> and <b>BOOST_PP_IIF</b>.
|
||||||
</div>
|
</div>
|
||||||
<h4>Usage</h4>
|
<h4>Usage</h4>
|
||||||
<div class="code">
|
<div class="code">
|
||||||
@ -14,11 +14,13 @@
|
|||||||
<h4>Contents</h4>
|
<h4>Contents</h4>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="../../ref/identity.html">BOOST_PP_IDENTITY</a></li>
|
<li><a href="../../ref/identity.html">BOOST_PP_IDENTITY</a></li>
|
||||||
|
<li><a href="../../ref/identity_n.html">BOOST_PP_IDENTITY_N</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<hr size="1">
|
<hr size="1">
|
||||||
<div style="margin-left: 0px;">
|
<div style="margin-left: 0px;">
|
||||||
<i><EFBFBD> Copyright <a href="http://www.housemarque.com" target="_top">Housemarque Oy</a> 2002</i>
|
<i><EFBFBD> Copyright <a href="http://www.housemarque.com" target="_top">Housemarque Oy</a> 2002</i>
|
||||||
</br><i><EFBFBD> Copyright Paul Mensonides 2002</i>
|
</br><i><EFBFBD> Copyright Paul Mensonides 2002</i>
|
||||||
|
</br><i><EFBFBD> Copyright Edward Diener 2015</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
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<title>tuple/enum.hpp</title>
|
<title>tuple/enum.hpp</title>
|
||||||
<link rel="stylesheet" type="text/css" href="../../styles.css"></head><body>
|
<link rel="stylesheet" type="text/css" href="../../styles.css"></head><body>
|
||||||
<div style="margin-left: 0px;">
|
<div style="margin-left: 0px;">
|
||||||
The <b>tuple/enum.hpp</b> header defines a macro to onvert a <i>tuple</i> to its comma-separated elements.
|
The <b>tuple/enum.hpp</b> header defines a macro to convert a <i>tuple</i> to its comma-separated elements.
|
||||||
</div>
|
</div>
|
||||||
<h4>Usage</h4>
|
<h4>Usage</h4>
|
||||||
<div class="code">
|
<div class="code">
|
||||||
|
@ -99,6 +99,7 @@
|
|||||||
<li><a href="ref/greater_equal_d.html">GREATER_EQUAL_D</a></li>
|
<li><a href="ref/greater_equal_d.html">GREATER_EQUAL_D</a></li>
|
||||||
<!-- I -->
|
<!-- I -->
|
||||||
<li><a href="ref/identity.html">IDENTITY</a></li>
|
<li><a href="ref/identity.html">IDENTITY</a></li>
|
||||||
|
<li><a href="ref/identity_n.html">IDENTITY_N</a></li>
|
||||||
<li><a href="ref/if.html">IF</a></li>
|
<li><a href="ref/if.html">IF</a></li>
|
||||||
<li><a href="ref/iif.html">IIF</a></li>
|
<li><a href="ref/iif.html">IIF</a></li>
|
||||||
<li><a href="ref/inc.html">INC</a></li>
|
<li><a href="ref/inc.html">INC</a></li>
|
||||||
|
58
doc/ref/identity_n.html
Normal file
58
doc/ref/identity_n.html
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>BOOST_PP_IDENTITY_N</title>
|
||||||
|
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div style="margin-left: 0px;">
|
||||||
|
The <b>BOOST_PP_IDENTITY_N</b> macro expands to its first argument when invoked.
|
||||||
|
</div>
|
||||||
|
<h4>Usage</h4>
|
||||||
|
<div class="code">
|
||||||
|
<b>BOOST_PP_IDENTITY_N</b>(<i>item,n</i>)(n-arguments)
|
||||||
|
</div>
|
||||||
|
<h4>Arguments</h4>
|
||||||
|
<dl>
|
||||||
|
<dt>item</dt>
|
||||||
|
<dd>
|
||||||
|
The result of the expansion.
|
||||||
|
</dd>
|
||||||
|
<dt>n</dt>
|
||||||
|
<dd>
|
||||||
|
The number of arguments when invoked.
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<h4>Remarks</h4>
|
||||||
|
<div>
|
||||||
|
This macro is designed to be used with <b>BOOST_PP_IF</b> and <b>BOOST_PP_IIF</b> when only one of the clauses needs to be invoked.
|
||||||
|
</div>
|
||||||
|
<h4>See Also</h4>
|
||||||
|
<ul>
|
||||||
|
<li><a href="if.html">BOOST_PP_IF</a></li>
|
||||||
|
<li><a href="iif.html">BOOST_PP_IIF</a></li>
|
||||||
|
</ul>
|
||||||
|
<h4>Requirements</h4>
|
||||||
|
<div>
|
||||||
|
<b>Header:</b> <a href="../headers/facilities/identity_n.html"><boost/preprocessor/facilities/identity.hpp></a>
|
||||||
|
</div>
|
||||||
|
<h4>Sample Code</h4>
|
||||||
|
<div><pre>
|
||||||
|
#include <<a href="../headers/control/if.html">boost/preprocessor/control/if.hpp</a>>
|
||||||
|
#include <<a href="../headers/facilities/identity.html">boost/preprocessor/facilities/identity.hpp</a>>
|
||||||
|
|
||||||
|
#define MACRO_CAT(y,z) y ## z
|
||||||
|
#define MACRO(n) <a href="if.html">BOOST_PP_IF</a>(n, <a href="identity_n.html">BOOST_PP_IDENTITY_N</a>(x,2), MACRO_CAT)(a,b)
|
||||||
|
|
||||||
|
MACRO(0) // expands to ab
|
||||||
|
MACRO(1) // expands to x
|
||||||
|
</pre></div>
|
||||||
|
<hr size="1">
|
||||||
|
<div style="margin-left: 0px"><i>© Copyright Edward Diener 2015</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>
|
@ -8,6 +8,7 @@
|
|||||||
# */
|
# */
|
||||||
#
|
#
|
||||||
# /* Revised by Paul Mensonides (2002) */
|
# /* Revised by Paul Mensonides (2002) */
|
||||||
|
# /* Revised by Edward Diener (2015) */
|
||||||
#
|
#
|
||||||
# /* See http://www.boost.org for most recent version. */
|
# /* See http://www.boost.org for most recent version. */
|
||||||
#
|
#
|
||||||
@ -15,9 +16,12 @@
|
|||||||
# define BOOST_PREPROCESSOR_FACILITIES_IDENTITY_HPP
|
# define BOOST_PREPROCESSOR_FACILITIES_IDENTITY_HPP
|
||||||
#
|
#
|
||||||
# include <boost/preprocessor/facilities/empty.hpp>
|
# include <boost/preprocessor/facilities/empty.hpp>
|
||||||
|
# include <boost/preprocessor/tuple/eat.hpp>
|
||||||
#
|
#
|
||||||
# /* BOOST_PP_IDENTITY */
|
# /* BOOST_PP_IDENTITY */
|
||||||
#
|
#
|
||||||
# define BOOST_PP_IDENTITY(item) item BOOST_PP_EMPTY
|
# define BOOST_PP_IDENTITY(item) item BOOST_PP_EMPTY
|
||||||
#
|
#
|
||||||
|
# define BOOST_PP_IDENTITY_N(item,n) item BOOST_PP_TUPLE_EAT_N(n)
|
||||||
|
#
|
||||||
# endif
|
# endif
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
# */
|
# */
|
||||||
#
|
#
|
||||||
# /* Revised by Paul Mensonides (2002-2011) */
|
# /* Revised by Paul Mensonides (2002-2011) */
|
||||||
# /* Revised by Edward Diener (2011) */
|
# /* Revised by Edward Diener (2011,2015) */
|
||||||
#
|
#
|
||||||
# /* See http://www.boost.org for most recent version. */
|
# /* See http://www.boost.org for most recent version. */
|
||||||
#
|
#
|
||||||
@ -38,6 +38,15 @@
|
|||||||
# endif
|
# endif
|
||||||
# define BOOST_PP_TUPLE_EAT_I(size) BOOST_PP_TUPLE_EAT_ ## size
|
# define BOOST_PP_TUPLE_EAT_I(size) BOOST_PP_TUPLE_EAT_ ## size
|
||||||
# endif
|
# endif
|
||||||
|
#
|
||||||
|
# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MWCC()
|
||||||
|
# define BOOST_PP_TUPLE_EAT_N(size) BOOST_PP_TUPLE_EAT_N_I(size)
|
||||||
|
# else
|
||||||
|
# define BOOST_PP_TUPLE_EAT_N(size) BOOST_PP_TUPLE_EAT_N_OO((size))
|
||||||
|
# define BOOST_PP_TUPLE_EAT_N_OO(par) BOOST_PP_TUPLE_EAT_N_I ## par
|
||||||
|
# endif
|
||||||
|
# define BOOST_PP_TUPLE_EAT_N_I(size) BOOST_PP_TUPLE_EAT_ ## size
|
||||||
|
#
|
||||||
# define BOOST_PP_TUPLE_EAT_1(e0)
|
# define BOOST_PP_TUPLE_EAT_1(e0)
|
||||||
# define BOOST_PP_TUPLE_EAT_2(e0, e1)
|
# define BOOST_PP_TUPLE_EAT_2(e0, e1)
|
||||||
# define BOOST_PP_TUPLE_EAT_3(e0, e1, e2)
|
# define BOOST_PP_TUPLE_EAT_3(e0, e1, e2)
|
||||||
|
@ -26,6 +26,7 @@ BEGIN BOOST_PP_APPLY((BOOST_PP_EMPTY))() 0 == 0 END
|
|||||||
BEGIN BOOST_PP_EXPAND(MACRO ARGS) == 1 END
|
BEGIN BOOST_PP_EXPAND(MACRO ARGS) == 1 END
|
||||||
|
|
||||||
BEGIN BOOST_PP_IDENTITY(1)() == 1 END
|
BEGIN BOOST_PP_IDENTITY(1)() == 1 END
|
||||||
|
BEGIN BOOST_PP_IDENTITY_N(36,10)(0,1,2,3,4,5,6,7,8,9) == 36 END
|
||||||
|
|
||||||
BEGIN BOOST_PP_CAT(BOOST_PP_INTERCEPT, 2) 1 == 1 END
|
BEGIN BOOST_PP_CAT(BOOST_PP_INTERCEPT, 2) 1 == 1 END
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user