mirror of
https://github.com/boostorg/preprocessor.git
synced 2025-07-15 13:36:33 +02:00
Added BOOST_PP_IF_THEN
[SVN r13127]
This commit is contained in:
@ -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)
|
||||
|
22
include/boost/preprocessor/if_then.hpp
Normal file
22
include/boost/preprocessor/if_then.hpp
Normal 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
|
Reference in New Issue
Block a user