Renamed BOOST_PP_IF_THEN to BOOST_PP_EXPR_IF

[SVN r13173]
This commit is contained in:
Vesa Karvonen
2002-03-11 16:11:34 +00:00
parent a3e207e706
commit fcd4b15cdf
12 changed files with 72 additions and 47 deletions

View File

@ -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)

View 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

View File

@ -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>

View File

@ -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