mirror of
https://github.com/boostorg/preprocessor.git
synced 2025-07-16 05:52:24 +02:00
Renamed BOOST_PP_IF_THEN to BOOST_PP_EXPR_IF
[SVN r13173]
This commit is contained in:
@ -19,6 +19,7 @@ BOOST_PP_ENUM_SHIFTED_PARAMS
|
||||
BOOST_PP_EQUAL
|
||||
BOOST_PP_EQUAL_D
|
||||
BOOST_PP_EXPAND
|
||||
BOOST_PP_EXPR_IF
|
||||
BOOST_PP_FOR
|
||||
BOOST_PP_GREATER
|
||||
BOOST_PP_GREATER_D
|
||||
@ -26,7 +27,6 @@ BOOST_PP_GREATER_EQUAL
|
||||
BOOST_PP_GREATER_EQUAL_D
|
||||
BOOST_PP_IDENTITY
|
||||
BOOST_PP_IF
|
||||
BOOST_PP_IF_THEN
|
||||
BOOST_PP_INC
|
||||
BOOST_PP_LESS
|
||||
BOOST_PP_LESS_D
|
||||
|
@ -19,7 +19,7 @@
|
||||
|
||||
<hr>
|
||||
|
||||
<a href="enum_shifted_params.htm">Prev</a> <a href="for.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
|
||||
<a href="enum_shifted_params.htm">Prev</a> <a href="expr_if.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
|
||||
<hr>
|
||||
|
||||
<h1>#include <<a href="../../../../boost/preprocessor/expand.hpp">boost/preprocessor/expand.hpp</a>></h1>
|
||||
@ -30,7 +30,7 @@
|
||||
<p>Essentially macro expands the parameter <code>X</code> twice.</p>
|
||||
<hr>
|
||||
|
||||
<a href="enum_shifted_params.htm">Prev</a> <a href="for.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
|
||||
<a href="enum_shifted_params.htm">Prev</a> <a href="expr_if.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
|
||||
<hr>
|
||||
|
||||
<p>Revised <!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %b %Y" startspan --><!--webbot bot="Timestamp" endspan i-checksum="15246" --></p>
|
||||
|
@ -19,21 +19,26 @@
|
||||
|
||||
<hr>
|
||||
|
||||
<a href="if.htm">Prev</a> <a href="inc.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
|
||||
<a href="expand.htm">Prev</a> <a href="for.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
|
||||
<hr>
|
||||
|
||||
<h1>#include <<a href="../../../../boost/preprocessor/if_then.hpp">boost/preprocessor/if_then.hpp</a>></h1>
|
||||
<h1>#include <<a href="../../../../boost/preprocessor/expr_if.hpp">boost/preprocessor/expr_if.hpp</a>></h1>
|
||||
|
||||
<hr>
|
||||
|
||||
<h2><a name="BOOST_PP_IF_THEN">#define BOOST_PP_IF_THEN</a>(C,T)</h2>
|
||||
<p>Expands to <code>T</code> if <code>C != 0</code> and to nothing if <code>C == 0</code>.</p>
|
||||
<h2><a name="BOOST_PP_EXPR_IF">#define BOOST_PP_EXPR_IF</a>(C,E)</h2>
|
||||
<p>Expands to <code>E</code> if <code>C != 0</code> and to nothing if <code>C == 0</code>.</p>
|
||||
|
||||
<p>For example, <code><a href="if_then.htm#BOOST_PP_IF_THEN">BOOST_PP_IF_THEN</a>(1,^)</code> expands to <code>^</code>.</p>
|
||||
<p>For example, <code><a href="expr_if.htm#BOOST_PP_EXPR_IF">BOOST_PP_EXPR_IF</a>(1,^)</code> expands to <code>^</code>.</p>
|
||||
|
||||
<h3>See</h3>
|
||||
<ul>
|
||||
<li><a href="if.htm#BOOST_PP_IF">BOOST_PP_IF</a>()</li>
|
||||
</ul>
|
||||
|
||||
<hr>
|
||||
|
||||
<a href="if.htm">Prev</a> <a href="inc.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
|
||||
<a href="expand.htm">Prev</a> <a href="for.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
|
||||
<hr>
|
||||
|
||||
<p>Revised <!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %b %Y" startspan --><!--webbot bot="Timestamp" endspan i-checksum="15246" --></p>
|
@ -19,7 +19,7 @@
|
||||
|
||||
<hr>
|
||||
|
||||
<a href="expand.htm">Prev</a> <a href="identity.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
|
||||
<a href="expr_if.htm">Prev</a> <a href="identity.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
|
||||
<hr>
|
||||
|
||||
<h1>#include <<a href="../../../../boost/preprocessor/for.hpp">boost/preprocessor/for.hpp</a>></h1>
|
||||
@ -89,7 +89,7 @@ invoking <a href="for.htm#BOOST_PP_FOR">BOOST_PP_FOR</a>##R() directly.</p>
|
||||
|
||||
<hr>
|
||||
|
||||
<a href="expand.htm">Prev</a> <a href="identity.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
|
||||
<a href="expr_if.htm">Prev</a> <a href="identity.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
|
||||
<hr>
|
||||
|
||||
<p>Revised <!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %b %Y" startspan --><!--webbot bot="Timestamp" endspan i-checksum="15246" --></p>
|
||||
|
@ -19,7 +19,7 @@
|
||||
|
||||
<hr>
|
||||
|
||||
<a href="identity.htm">Prev</a> <a href="if_then.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
|
||||
<a href="identity.htm">Prev</a> <a href="inc.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
|
||||
<hr>
|
||||
|
||||
<h1>#include <<a href="../../../../boost/preprocessor/if.hpp">boost/preprocessor/if.hpp</a>></h1>
|
||||
@ -32,6 +32,11 @@
|
||||
|
||||
<p>For example, <code><a href="if.htm#BOOST_PP_IF">BOOST_PP_IF</a>(0,1,2)</code> expands to <code>2</code>.</p>
|
||||
|
||||
<h3>See</h3>
|
||||
<ul>
|
||||
<li><a href="expr_if.htm#BOOST_PP_EXPR_IF">BOOST_PP_EXPR_IF</a>()</li>
|
||||
</ul>
|
||||
|
||||
<h3>Test</h3>
|
||||
<ul>
|
||||
<li><a href="../../test/preprocessor_test.cpp">preprocessor_test.cpp</a></li>
|
||||
@ -43,7 +48,7 @@
|
||||
<p>Obsolete. Use <a href="if.htm#BOOST_PP_IF">BOOST_PP_IF</a>().</p>
|
||||
<hr>
|
||||
|
||||
<a href="identity.htm">Prev</a> <a href="if_then.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
|
||||
<a href="identity.htm">Prev</a> <a href="inc.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
|
||||
<hr>
|
||||
|
||||
<p>Revised <!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %b %Y" startspan --><!--webbot bot="Timestamp" endspan i-checksum="15246" --></p>
|
||||
|
@ -19,7 +19,7 @@
|
||||
|
||||
<hr>
|
||||
|
||||
<a href="if_then.htm">Prev</a> <a href="limits.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
|
||||
<a href="if.htm">Prev</a> <a href="limits.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
|
||||
<hr>
|
||||
|
||||
<h1>#include <<a href="../../../../boost/preprocessor/inc.hpp">boost/preprocessor/inc.hpp</a>></h1>
|
||||
@ -44,7 +44,7 @@ supported.</p>
|
||||
<p>Obsolete. Use <a href="inc.htm#BOOST_PP_INC">BOOST_PP_INC</a>().</p>
|
||||
<hr>
|
||||
|
||||
<a href="if_then.htm">Prev</a> <a href="limits.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
|
||||
<a href="if.htm">Prev</a> <a href="limits.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
|
||||
<hr>
|
||||
|
||||
<p>Revised <!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %b %Y" startspan --><!--webbot bot="Timestamp" endspan i-checksum="15246" --></p>
|
||||
|
@ -42,6 +42,7 @@
|
||||
<dt><a href="comparison_equal.htm#BOOST_PP_EQUAL">BOOST_PP_EQUAL</a></dt>
|
||||
<dt><a href="comparison_equal.htm#BOOST_PP_EQUAL_D">BOOST_PP_EQUAL_D</a></dt>
|
||||
<dt><a href="expand.htm#BOOST_PP_EXPAND">BOOST_PP_EXPAND</a></dt>
|
||||
<dt><a href="expr_if.htm#BOOST_PP_EXPR_IF">BOOST_PP_EXPR_IF</a></dt>
|
||||
<dt><a href="for.htm#BOOST_PP_FOR">BOOST_PP_FOR</a></dt>
|
||||
<dt><a href="comparison_greater.htm#BOOST_PP_GREATER">BOOST_PP_GREATER</a></dt>
|
||||
<dt><a href="comparison_greater.htm#BOOST_PP_GREATER_D">BOOST_PP_GREATER_D</a></dt>
|
||||
@ -49,7 +50,6 @@
|
||||
<dt><a href="comparison_greater_equal.htm#BOOST_PP_GREATER_EQUAL_D">BOOST_PP_GREATER_EQUAL_D</a></dt>
|
||||
<dt><a href="identity.htm#BOOST_PP_IDENTITY">BOOST_PP_IDENTITY</a></dt>
|
||||
<dt><a href="if.htm#BOOST_PP_IF">BOOST_PP_IF</a></dt>
|
||||
<dt><a href="if_then.htm#BOOST_PP_IF_THEN">BOOST_PP_IF_THEN</a></dt>
|
||||
<dt><a href="inc.htm#BOOST_PP_INC">BOOST_PP_INC</a></dt>
|
||||
<dt><a href="comparison_less.htm#BOOST_PP_LESS">BOOST_PP_LESS</a></dt>
|
||||
<dt><a href="comparison_less.htm#BOOST_PP_LESS_D">BOOST_PP_LESS_D</a></dt>
|
||||
@ -197,10 +197,10 @@
|
||||
<dt>#include <<a href="enum_shifted.htm">boost/preprocessor/enum_shifted.hpp</a>></dt>
|
||||
<dt>#include <<a href="enum_shifted_params.htm">boost/preprocessor/enum_shifted_params.hpp</a>></dt>
|
||||
<dt>#include <<a href="expand.htm">boost/preprocessor/expand.hpp</a>></dt>
|
||||
<dt>#include <<a href="expr_if.htm">boost/preprocessor/expr_if.hpp</a>></dt>
|
||||
<dt>#include <<a href="for.htm">boost/preprocessor/for.hpp</a>></dt>
|
||||
<dt>#include <<a href="identity.htm">boost/preprocessor/identity.hpp</a>></dt>
|
||||
<dt>#include <<a href="if.htm">boost/preprocessor/if.hpp</a>></dt>
|
||||
<dt>#include <<a href="if_then.htm">boost/preprocessor/if_then.hpp</a>></dt>
|
||||
<dt>#include <<a href="inc.htm">boost/preprocessor/inc.hpp</a>></dt>
|
||||
<dt>#include <<a href="limits.htm">boost/preprocessor/limits.hpp</a>></dt>
|
||||
<dt>#include <<a href="list.htm">boost/preprocessor/list.hpp</a>></dt>
|
||||
|
@ -13,7 +13,7 @@
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
#include <boost/preprocessor/if_then.hpp>
|
||||
#include <boost/preprocessor/expr_if.hpp>
|
||||
#include <boost/preprocessor/logical/not.hpp>
|
||||
|
||||
/** <p>Expands to nothing if <code>C != 0</code> and to <code>MSG</code> if
|
||||
@ -21,7 +21,7 @@
|
||||
|
||||
<p>For example, <code>BOOST_PP_ASSERT_MSG(1,A BUG!)</code> expands to <code>A BUG!</code>.</p>
|
||||
*/
|
||||
#define BOOST_PP_ASSERT_MSG(C,MSG) BOOST_PP_IF_THEN(BOOST_PP_NOT(C),MSG)
|
||||
#define BOOST_PP_ASSERT_MSG(C,MSG) BOOST_PP_EXPR_IF(BOOST_PP_NOT(C),MSG)
|
||||
|
||||
/** <p>Obsolete. Use BOOST_PP_ASSERT_MSG().</p> */
|
||||
#define BOOST_PREPROCESSOR_ASSERT_MSG(C,MSG) BOOST_PP_ASSERT_MSG(C,MSG)
|
||||
|
33
include/boost/preprocessor/expr_if.hpp
Normal file
33
include/boost/preprocessor/expr_if.hpp
Normal file
@ -0,0 +1,33 @@
|
||||
#ifndef BOOST_PREPROCESSOR_EXPR_IF_HPP
|
||||
#define BOOST_PREPROCESSOR_EXPR_IF_HPP
|
||||
|
||||
/* Copyright (C) 2002
|
||||
* Housemarque Oy
|
||||
* http://www.housemarque.com
|
||||
*
|
||||
* Permission to copy, use, modify, sell and distribute this software is
|
||||
* granted provided this copyright notice appears in all copies. This
|
||||
* software is provided "as is" without express or implied warranty, and
|
||||
* with no claim as to its suitability for any purpose.
|
||||
*
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
#include <boost/preprocessor/logical/bool.hpp>
|
||||
|
||||
/** <p>Expands to <code>E</code> if <code>C != 0</code> and to nothing if <code>C == 0</code>.</p>
|
||||
|
||||
<p>For example, <code>BOOST_PP_EXPR_IF(1,^)</code> expands to <code>^</code>.</p>
|
||||
|
||||
<h3>See</h3>
|
||||
<ul>
|
||||
<li>BOOST_PP_IF()</li>
|
||||
</ul>
|
||||
*/
|
||||
#define BOOST_PP_EXPR_IF(C,E) BOOST_PP_EXPR_IF_BOOL(BOOST_PP_BOOL(C),E)
|
||||
|
||||
#define BOOST_PP_EXPR_IF_BOOL(C,E) BOOST_PP_EXPR_IF_BOOL_DELAY(C,E)
|
||||
#define BOOST_PP_EXPR_IF_BOOL_DELAY(C,E) BOOST_PP_EXPR_IF_BOOL##C(E)
|
||||
#define BOOST_PP_EXPR_IF_BOOL0(E)
|
||||
#define BOOST_PP_EXPR_IF_BOOL1(E) E
|
||||
#endif
|
@ -21,6 +21,11 @@
|
||||
|
||||
<p>For example, <code>BOOST_PP_IF(0,1,2)</code> expands to <code>2</code>.</p>
|
||||
|
||||
<h3>See</h3>
|
||||
<ul>
|
||||
<li>BOOST_PP_EXPR_IF()</li>
|
||||
</ul>
|
||||
|
||||
<h3>Test</h3>
|
||||
<ul>
|
||||
<li><a href="../../test/preprocessor_test.cpp">preprocessor_test.cpp</a></li>
|
||||
|
@ -1,28 +0,0 @@
|
||||
#ifndef BOOST_PREPROCESSOR_IF_THEN_HPP
|
||||
#define BOOST_PREPROCESSOR_IF_THEN_HPP
|
||||
|
||||
/* Copyright (C) 2002
|
||||
* Housemarque Oy
|
||||
* http://www.housemarque.com
|
||||
*
|
||||
* Permission to copy, use, modify, sell and distribute this software is
|
||||
* granted provided this copyright notice appears in all copies. This
|
||||
* software is provided "as is" without express or implied warranty, and
|
||||
* with no claim as to its suitability for any purpose.
|
||||
*
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
#include <boost/preprocessor/logical/bool.hpp>
|
||||
|
||||
/** <p>Expands to <code>T</code> if <code>C != 0</code> and to nothing if <code>C == 0</code>.</p>
|
||||
|
||||
<p>For example, <code>BOOST_PP_IF_THEN(1,^)</code> expands to <code>^</code>.</p>
|
||||
*/
|
||||
#define BOOST_PP_IF_THEN(C,T) BOOST_PP_IF_THEN_BOOL(BOOST_PP_BOOL(C),T)
|
||||
|
||||
#define BOOST_PP_IF_THEN_BOOL(C,T) BOOST_PP_IF_THEN_BOOL_DELAY(C,T)
|
||||
#define BOOST_PP_IF_THEN_BOOL_DELAY(C,T) BOOST_PP_IF_THEN_BOOL##C(T)
|
||||
#define BOOST_PP_IF_THEN_BOOL0(T)
|
||||
#define BOOST_PP_IF_THEN_BOOL1(T) T
|
||||
#endif
|
@ -13,6 +13,7 @@
|
||||
#include <boost/preprocessor/empty.hpp>
|
||||
#include <boost/preprocessor/identity.hpp>
|
||||
#include <boost/preprocessor/if.hpp>
|
||||
#include <boost/preprocessor/expr_if.hpp>
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
#include <boost/preprocessor/stringize.hpp>
|
||||
|
||||
@ -40,6 +41,10 @@ TEST_B BOOST_PP_IF(BOOST_PP_IF(1,1,1),true,false) &&
|
||||
|
||||
/* *** */
|
||||
|
||||
TEST_B BOOST_PP_EXPR_IF(1,1) TEST_E
|
||||
|
||||
/* *** */
|
||||
|
||||
#if !(!defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__))
|
||||
TEST_B BOOST_PP_CAT(BOOST_PP_IF(1,tru,fals), MACRO MACRO_ARGS(e)) TEST_E
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user