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_SEQ_HPP)
8 #define BOOST_VMD_ASSERT_IS_SEQ_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_SEQ(sequence)
25 \brief Asserts that the sequence is a Boost PP seq.
27 The macro checks that the sequence is a Boost PP seq.
28 If it is not a Boost PP seq, it forces a compiler error.
30 The macro normally checks for a Boost PP seq 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 seq.
39 returns = Normally the macro returns nothing.
41 If the sequence is a Boost PP seq, nothing is
44 For VC++, because there is no sure way of forcing
45 a compiler error from within a macro without producing
46 output, if the sequence is not a Boost PP seq the
47 macro forces a compiler error by outputting invalid C++.
49 For all other compilers a compiler error is forced
50 without producing output if the sequence is not a
57 /** \def BOOST_VMD_ASSERT_IS_SEQ_D(d,sequence)
59 \brief Asserts that the sequence is a Boost PP seq. Re-entrant version.
61 The macro checks that the sequence is a Boost PP seq.
62 If it is not a Boost PP seq, it forces a compiler error.
64 The macro normally checks for a Boost PP seq only in
65 debug mode. However an end-user can force the macro
66 to check or not check by defining the macro
67 BOOST_VMD_ASSERT_DATA to 1 or 0 respectively.
69 d = The next available BOOST_PP_WHILE iteration. <br/>
70 sequence = a possible Boost PP seq.
74 returns = Normally the macro returns nothing.
76 If the sequence is a Boost PP seq, nothing is
79 For VC++, because there is no sure way of forcing
80 a compiler error from within a macro without producing
81 output, if the sequence is not a Boost PP seq the
82 macro forces a compiler error by outputting invalid C++.
84 For all other compilers a compiler error is forced
85 without producing output if the sequence is not a
92 #if !BOOST_VMD_ASSERT_DATA
94 #define BOOST_VMD_ASSERT_IS_SEQ(sequence)
95 #define BOOST_VMD_ASSERT_IS_SEQ_D(d,sequence)
99 #include <boost/vmd/assert.hpp>
100 #include <boost/vmd/is_seq.hpp>
102 #define BOOST_VMD_ASSERT_IS_SEQ(sequence) \
105 BOOST_VMD_IS_SEQ(sequence), \
106 BOOST_VMD_ASSERT_IS_SEQ_ERROR \
110 #define BOOST_VMD_ASSERT_IS_SEQ_D(d,sequence) \
113 BOOST_VMD_IS_SEQ_D(d,sequence), \
114 BOOST_VMD_ASSERT_IS_SEQ_ERROR \
118 #endif /* BOOST_VMD_ASSERT_DATA */
120 #endif /* BOOST_PP_VARIADICS */
121 #endif /* BOOST_VMD_ASSERT_IS_SEQ_HPP */