Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:53:38

0001 
0002 //  (C) Copyright Edward Diener 2011-2015
0003 //  Use, modification and distribution are subject to the Boost Software License,
0004 //  Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
0005 //  http://www.boost.org/LICENSE_1_0.txt).
0006 
0007 #if !defined(BOOST_VMD_ASSERT_IS_EMPTY_HPP)
0008 #define BOOST_VMD_ASSERT_IS_EMPTY_HPP
0009 
0010 #include <boost/vmd/detail/setup.hpp>
0011 
0012 #if BOOST_PP_VARIADICS
0013 
0014 #if BOOST_VMD_ASSERT_DATA
0015 
0016 #include <boost/vmd/assert.hpp>
0017 #include <boost/vmd/is_empty.hpp>
0018 
0019 #endif
0020 
0021 /*
0022 
0023   The succeeding comments in this file are in doxygen format.
0024 
0025 */
0026 
0027 /** \file
0028 */
0029 
0030 /** \def BOOST_VMD_ASSERT_IS_EMPTY(...)
0031 
0032     \brief Asserts that the input is empty.
0033 
0034     The macro checks to see if the input is empty or not.
0035     If it is not empty, it forces a compiler error.
0036     
0037     The macro is a variadic macro taking any input.
0038     For the VC++8 compiler (VS2005) the macro takes a single parameter of input to check and not variadic data.
0039     
0040     The macro normally checks for emptiness only in 
0041     debug mode. However an end-user can force the macro 
0042     to check or not check by defining the macro 
0043     BOOST_VMD_ASSERT_DATA to 1 or 0 respectively.
0044   
0045     .... = variadic input, for VC++8 this must be a single parameter.
0046 
0047   @code
0048   
0049     returns = Normally the macro returns nothing. 
0050     
0051               If the input is empty, nothing is output.
0052               
0053               For VC++, because there is no sure way of forcing  
0054               a compiler error from within a macro without producing
0055               output, if the input is not empty the 
0056               macro forces a compiler error by outputting invalid C++.
0057               
0058               For all other compilers a compiler error is forced 
0059               without producing output if the input is not empty.
0060     
0061   @endcode
0062   
0063     It is recommended to append BOOST_PP_EMPTY() to whatever input
0064     is being tested in order to avoid possible warning messages 
0065     from some compilers about no parameters being passed to the macro
0066     when the input is truly empty.
0067     
0068 */
0069 
0070 #if BOOST_VMD_MSVC_V8
0071 
0072 #if !BOOST_VMD_ASSERT_DATA
0073 
0074 #define BOOST_VMD_ASSERT_IS_EMPTY(input)
0075 
0076 #else
0077 
0078 #define BOOST_VMD_ASSERT_IS_EMPTY(input) \
0079     BOOST_VMD_ASSERT \
0080           ( \
0081           BOOST_VMD_IS_EMPTY(input), \
0082           BOOST_VMD_IS_EMPTY_ASSERT_ERROR \
0083           ) \
0084 /**/
0085 
0086 #endif // !BOOST_VMD_ASSERT_DATA
0087 
0088 #else
0089 
0090 #if !BOOST_VMD_ASSERT_DATA
0091 
0092 #define BOOST_VMD_ASSERT_IS_EMPTY(...)
0093 
0094 #else
0095 
0096 #define BOOST_VMD_ASSERT_IS_EMPTY(...) \
0097     BOOST_VMD_ASSERT \
0098           ( \
0099           BOOST_VMD_IS_EMPTY(__VA_ARGS__), \
0100           BOOST_VMD_IS_EMPTY_ASSERT_ERROR \
0101           ) \
0102 /**/
0103 
0104 #endif // !BOOST_VMD_ASSERT_DATA
0105 
0106 #endif /* BOOST_VMD_MSVC_V8 */
0107 
0108 #endif /* BOOST_PP_VARIADICS */
0109 #endif /* BOOST_VMD_ASSERT_IS_EMPTY_HPP */