Added BOOST_PP_IF_THEN

[SVN r13127]
This commit is contained in:
Vesa Karvonen
2002-03-08 07:30:26 +00:00
parent 7980b6e377
commit 717666e5d4
7 changed files with 78 additions and 7 deletions

View File

@ -26,6 +26,7 @@ BOOST_PP_GREATER_EQUAL
BOOST_PP_GREATER_EQUAL_D BOOST_PP_GREATER_EQUAL_D
BOOST_PP_IDENTITY BOOST_PP_IDENTITY
BOOST_PP_IF BOOST_PP_IF
BOOST_PP_IF_THEN
BOOST_PP_INC BOOST_PP_INC
BOOST_PP_LESS BOOST_PP_LESS
BOOST_PP_LESS_D BOOST_PP_LESS_D

View File

@ -19,7 +19,7 @@
<hr> <hr>
<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> <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>
<hr> <hr>
<h1>#include &lt;<a href="../../../../boost/preprocessor/if.hpp">boost/preprocessor/if.hpp</a>&gt;</h1> <h1>#include &lt;<a href="../../../../boost/preprocessor/if.hpp">boost/preprocessor/if.hpp</a>&gt;</h1>
@ -44,7 +44,7 @@
<p>Obsolete. Use <a href="if.htm#BOOST_PP_IF">BOOST_PP_IF</a>().</p> <p>Obsolete. Use <a href="if.htm#BOOST_PP_IF">BOOST_PP_IF</a>().</p>
<hr> <hr>
<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> <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>
<hr> <hr>
<p>Revised <!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %b %Y" startspan --><!--webbot bot="Timestamp" endspan i-checksum="15246" --></p> <p>Revised <!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %b %Y" startspan --><!--webbot bot="Timestamp" endspan i-checksum="15246" --></p>

46
doc/reference/if_then.htm Normal file
View File

@ -0,0 +1,46 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Boost.Preprocessor - Reference</title>
</head>
<body bgcolor="#FFFFFF" link="#0000ff" vlink="#800080">
<table border="0" cellpadding="7" cellspacing="0" width="100%" summary=
"header">
<tr>
<td valign="top" width="300">
<h3><a href="../../../../index.htm"><img height="86" width="277" alt="C++ Boost" src="../../../../c++boost.gif" border="0"></a></h3>
</td>
<td valign="top">
<h1 align="center">Boost.Preprocessor</h1>
<h2 align="center">Reference</h2>
</td>
</tr>
</table>
<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>
<hr>
<h1>#include &lt;<a href="../../../../boost/preprocessor/if_then.hpp">boost/preprocessor/if_then.hpp</a>&gt;</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>
<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>
<hr>
<p>Revised <!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %b %Y" startspan --><!--webbot bot="Timestamp" endspan i-checksum="15246" --></p>
<p><i>&copy; Copyright <a href="http://www.housemarque.com">Housemarque Oy</a> 2002</i></p>
<p><i>Permission to copy, use, modify, sell and distribute this document is granted
provided this copyright notice appears in all copies. This document is provided
"as is" without express or implied warranty, and with no claim as to its suitability
for any purpose.</i></p>
</body></html>

View File

@ -19,7 +19,7 @@
<hr> <hr>
<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> <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>
<hr> <hr>
<h1>#include &lt;<a href="../../../../boost/preprocessor/inc.hpp">boost/preprocessor/inc.hpp</a>&gt;</h1> <h1>#include &lt;<a href="../../../../boost/preprocessor/inc.hpp">boost/preprocessor/inc.hpp</a>&gt;</h1>
@ -44,7 +44,7 @@ supported.</p>
<p>Obsolete. Use <a href="inc.htm#BOOST_PP_INC">BOOST_PP_INC</a>().</p> <p>Obsolete. Use <a href="inc.htm#BOOST_PP_INC">BOOST_PP_INC</a>().</p>
<hr> <hr>
<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> <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>
<hr> <hr>
<p>Revised <!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %b %Y" startspan --><!--webbot bot="Timestamp" endspan i-checksum="15246" --></p> <p>Revised <!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %b %Y" startspan --><!--webbot bot="Timestamp" endspan i-checksum="15246" --></p>

View File

@ -49,6 +49,7 @@
<dt><a href="comparison_greater_equal.htm#BOOST_PP_GREATER_EQUAL_D">BOOST_PP_GREATER_EQUAL_D</a></dt> <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="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.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="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">BOOST_PP_LESS</a></dt>
<dt><a href="comparison_less.htm#BOOST_PP_LESS_D">BOOST_PP_LESS_D</a></dt> <dt><a href="comparison_less.htm#BOOST_PP_LESS_D">BOOST_PP_LESS_D</a></dt>
@ -199,6 +200,7 @@
<dt>#include &lt;<a href="for.htm">boost/preprocessor/for.hpp</a>&gt;</dt> <dt>#include &lt;<a href="for.htm">boost/preprocessor/for.hpp</a>&gt;</dt>
<dt>#include &lt;<a href="identity.htm">boost/preprocessor/identity.hpp</a>&gt;</dt> <dt>#include &lt;<a href="identity.htm">boost/preprocessor/identity.hpp</a>&gt;</dt>
<dt>#include &lt;<a href="if.htm">boost/preprocessor/if.hpp</a>&gt;</dt> <dt>#include &lt;<a href="if.htm">boost/preprocessor/if.hpp</a>&gt;</dt>
<dt>#include &lt;<a href="if_then.htm">boost/preprocessor/if_then.hpp</a>&gt;</dt>
<dt>#include &lt;<a href="inc.htm">boost/preprocessor/inc.hpp</a>&gt;</dt> <dt>#include &lt;<a href="inc.htm">boost/preprocessor/inc.hpp</a>&gt;</dt>
<dt>#include &lt;<a href="limits.htm">boost/preprocessor/limits.hpp</a>&gt;</dt> <dt>#include &lt;<a href="limits.htm">boost/preprocessor/limits.hpp</a>&gt;</dt>
<dt>#include &lt;<a href="list.htm">boost/preprocessor/list.hpp</a>&gt;</dt> <dt>#include &lt;<a href="list.htm">boost/preprocessor/list.hpp</a>&gt;</dt>

View File

@ -13,12 +13,12 @@
* See http://www.boost.org for most recent version. * See http://www.boost.org for most recent version.
*/ */
#include <boost/preprocessor/empty.hpp> #include <boost/preprocessor/if_then.hpp>
#include <boost/preprocessor/if.hpp> #include <boost/preprocessor/logical/not.hpp>
/** <p>Expands to nothing if <code>C != 0</code> and to <code>MSG</code> if /** <p>Expands to nothing if <code>C != 0</code> and to <code>MSG</code> if
<code>C == 0</code>.</p> */ <code>C == 0</code>.</p> */
#define BOOST_PP_ASSERT_MSG(C,MSG) BOOST_PP_IF(C,BOOST_PP_EMPTY,MSG BOOST_PP_EMPTY)() #define BOOST_PP_ASSERT_MSG(C,MSG) BOOST_PP_IF_THEN(BOOST_PP_NOT(C),MSG)
/** <p>Obsolete. Use BOOST_PP_ASSERT_MSG().</p> */ /** <p>Obsolete. Use BOOST_PP_ASSERT_MSG().</p> */
#define BOOST_PREPROCESSOR_ASSERT_MSG(C,MSG) BOOST_PP_ASSERT_MSG(C,MSG) #define BOOST_PREPROCESSOR_ASSERT_MSG(C,MSG) BOOST_PP_ASSERT_MSG(C,MSG)

View File

@ -0,0 +1,22 @@
#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/empty.hpp>
#include <boost/preprocessor/if.hpp>
/** <p>Expands to <code>T</code> if <code>C != 0</code> and to nothing if <code>C == 0</code>.</p>
*/
#define BOOST_PP_IF_THEN(C,T) BOOST_PP_IF(C,T BOOST_PP_EMPTY,BOOST_PP_EMPTY)()
#endif