2 // (C) Copyright Edward Diener 2011-2015
3 // Use, modification and distribution are subject to the Boost Software License,
4 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
5 // http://www.boost.org/LICENSE_1_0.txt).
7 #if !defined(BOOST_VMD_ASSERT_HPP)
8 #define BOOST_VMD_ASSERT_HPP
10 #include <boost/vmd/detail/setup.hpp>
12 #if BOOST_PP_VARIADICS
14 #include <boost/vmd/detail/assert.hpp>
18 The succeeding comments in this file are in doxygen format.
25 /** \def BOOST_VMD_ASSERT(...)
27 \brief Conditionally causes an error to be generated.
29 ... = variadic parameters, maximum of 2 will be considered.
30 Any variadic parameters beyond the maximum of 2 are just ignored.
32 The first variadic parameter is:
34 cond = A condition that determines whether an assertion occurs. Valid values range from 0 to BOOST_PP_LIMIT_MAG.
36 The second variadic parameter (optional) is:
38 errstr = An error string for generating a compiler error when using the VC++ compiler.
39 The VC++ compiler is incapable of producing a preprocessor error so when the 'cond'
40 is 0, a compiler error is generated by outputting C++ code in the form of:
42 typedef char errstr[-1];
44 The errstr defaults to BOOST_VMD_ASSERT_ERROR if not supplied.
45 It is only relevant for VC++.
47 returns = If cond expands to 0, this macro causes an error. Otherwise, it expands to nothing.
48 For all compilers other than Visual C++ the error is a preprocessing error.
49 For Visual C++ the error is caused by output invalid C++: this error could be
50 masked if the invalid output is ignored by a macro which invokes this macro.
53 # define BOOST_VMD_ASSERT(...) \
54 BOOST_VMD_DETAIL_ASSERT(__VA_ARGS__) \
57 #endif /* BOOST_PP_VARIADICS */
58 #endif /* BOOST_VMD_ASSERT_HPP */