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_HPP)
0008 #define BOOST_VMD_ASSERT_HPP
0009 
0010 #include <boost/vmd/detail/setup.hpp>
0011 
0012 #if BOOST_PP_VARIADICS
0013 
0014 #include <boost/vmd/detail/assert.hpp>
0015 
0016 /*
0017 
0018   The succeeding comments in this file are in doxygen format.
0019 
0020 */
0021 
0022 /** \file
0023 */
0024 
0025 /** \def BOOST_VMD_ASSERT(...)
0026 
0027     \brief Conditionally causes an error to be generated.
0028   
0029     ...  = variadic parameters, maximum of 2 will be considered.
0030            Any variadic parameters beyond the maximum of 2 are just ignored.
0031   
0032     The first variadic parameter is:
0033 
0034     cond = A condition that determines whether an assertion occurs.  Valid values range from 0 to BOOST_PP_LIMIT_MAG.
0035     
0036     The second variadic parameter (optional) is:
0037    
0038     errstr = An error string for generating a compiler error when using the VC++ compiler.
0039             The VC++ compiler is incapable of producing a preprocessor error so when the 'cond'
0040             is 0, a compiler error is generated by outputting C++ code in the form of:
0041             
0042   @code
0043   
0044             typedef char errstr[-1];
0045             
0046   @endcode
0047   
0048     The errstr defaults to BOOST_VMD_ASSERT_ERROR if not supplied.
0049     It is only relevant for VC++.
0050 
0051     returns = If cond expands to 0, this macro causes an error.  Otherwise, it expands to nothing.
0052               For all compilers other than Visual C++ the error is a preprocessing error.
0053               For Visual C++ the error is caused by output invalid C++: this error could be
0054               masked if the invalid output is ignored by a macro which invokes this macro.
0055     
0056 */
0057 # define BOOST_VMD_ASSERT(...) \
0058     BOOST_VMD_DETAIL_ASSERT(__VA_ARGS__) \
0059 /**/
0060 
0061 #endif /* BOOST_PP_VARIADICS */
0062 #endif /* BOOST_VMD_ASSERT_HPP */