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_IS_LIST_HPP)
8 #define BOOST_VMD_ASSERT_IS_LIST_HPP
10 #include <boost/vmd/detail/setup.hpp>
12 #if BOOST_PP_VARIADICS
16 The succeeding comments in this file are in doxygen format.
23 /** \def BOOST_VMD_ASSERT_IS_LIST(sequence)
25 \brief Asserts that the sequence is a Boost PP list.
27 The macro checks that the sequence is a Boost PP list.
28 If it is not a Boost PP list, it forces a compiler error.
30 The macro normally checks for a Boost PP list only in
31 debug mode. However an end-user can force the macro
32 to check or not check by defining the macro
33 BOOST_VMD_ASSERT_DATA to 1 or 0 respectively.
35 sequence = a possible Boost PP list.
37 returns = Normally the macro returns nothing.
39 If the sequence is a Boost PP list, nothing is
42 For VC++, because there is no sure way of forcing
43 a compiler error from within a macro without producing
44 output, if the sequence is not a Boost PP list the
45 macro forces a compiler error by outputting invalid C++.
47 For all other compilers a compiler error is forced
48 without producing output if the parameter is not a
53 /** \def BOOST_VMD_ASSERT_IS_LIST_D(d,sequence)
55 \brief Asserts that the sequence is a Boost PP list. Re-entrant version.
57 The macro checks that the sequence is a Boost PP list.
58 If it is not a Boost PP list, it forces a compiler error.
60 The macro normally checks for a Boost PP list only in
61 debug mode. However an end-user can force the macro
62 to check or not check by defining the macro
63 BOOST_VMD_ASSERT_DATA to 1 or 0 respectively.
65 d = The next available BOOST_PP_WHILE iteration.
66 sequence = a possible Boost PP list.
68 returns = Normally the macro returns nothing.
70 If the sequence is a Boost PP list, nothing is
73 For VC++, because there is no sure way of forcing
74 a compiler error from within a macro without producing
75 output, if the sequence is not a Boost PP list the
76 macro forces a compiler error by outputting invalid C++.
78 For all other compilers a compiler error is forced
79 without producing output if the parameter is not a
84 #if !BOOST_VMD_ASSERT_DATA
86 #define BOOST_VMD_ASSERT_IS_LIST(sequence)
87 #define BOOST_VMD_ASSERT_IS_LIST_D(d,sequence)
91 #include <boost/vmd/assert.hpp>
92 #include <boost/vmd/is_list.hpp>
94 #define BOOST_VMD_ASSERT_IS_LIST(sequence) \
97 BOOST_VMD_IS_LIST(sequence), \
98 BOOST_VMD_ASSERT_IS_LIST_ERROR \
102 #define BOOST_VMD_ASSERT_IS_LIST_D(d,sequence) \
105 BOOST_VMD_IS_LIST_D(d,sequence), \
106 BOOST_VMD_ASSERT_IS_LIST_ERROR \
110 #endif /* BOOST_VMD_ASSERT_DATA */
112 #endif /* BOOST_PP_VARIADICS */
113 #endif /* BOOST_VMD_ASSERT_IS_LIST_HPP */