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

@ -13,12 +13,12 @@
* See http://www.boost.org for most recent version.
*/
#include <boost/preprocessor/empty.hpp>
#include <boost/preprocessor/if.hpp>
#include <boost/preprocessor/if_then.hpp>
#include <boost/preprocessor/logical/not.hpp>
/** <p>Expands to nothing if <code>C != 0</code> and to <code>MSG</code> if
<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> */
#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