Project revived from Feb2017
[EroSomnia.git] / deps / boost_1_63_0 / boost / vmd / assert_is_type.hpp
blob5bf86d1cac950bdd0c071554bb5f7eb4cd674290
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_TYPE_HPP)
8 #define BOOST_VMD_ASSERT_IS_TYPE_HPP
10 #include <boost/vmd/detail/setup.hpp>
12 #if BOOST_PP_VARIADICS
16 The succeeding comments in this file are in doxygen format.
20 /** \file
23 /** \def BOOST_VMD_ASSERT_IS_TYPE(sequence)
25 \brief Asserts that the sequence is a VMD type.
27 The macro checks that the sequence is a VMD type.
28 If it is not a VMD type, it forces a compiler error.
30 The macro normally checks for a VMD type 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 VMD type.
37 returns = Normally the macro returns nothing.
39 If the sequence is a VMD type, nothing is
40 output.
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 VMD type 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 sequence is not a
49 VMD type.
53 /** \def BOOST_VMD_ASSERT_IS_TYPE_D(d,sequence)
55 \brief Asserts that the sequence is a VMD type. Re-entrant version.
57 The macro checks that the sequence is a VMD type.
58 If it is not a VMD type, it forces a compiler error.
60 The macro normally checks for a VMD type 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 VMD type.
68 returns = Normally the macro returns nothing.
70 If the sequence is a VMD type, nothing is
71 output.
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 VMD type 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 sequence is not a
80 VMD type.
84 #if !BOOST_VMD_ASSERT_DATA
86 #define BOOST_VMD_ASSERT_IS_TYPE(sequence)
87 #define BOOST_VMD_ASSERT_IS_TYPE_D(d,sequence)
89 #else
91 #include <boost/vmd/assert.hpp>
92 #include <boost/vmd/is_type.hpp>
94 #define BOOST_VMD_ASSERT_IS_TYPE(sequence) \
95 BOOST_VMD_ASSERT \
96 ( \
97 BOOST_VMD_IS_TYPE(sequence), \
98 BOOST_VMD_IS_TYPE_ASSERT_ERROR \
99 ) \
100 /**/
102 #define BOOST_VMD_ASSERT_IS_TYPE_D(d,sequence) \
103 BOOST_VMD_ASSERT \
105 BOOST_VMD_IS_TYPE_D(d,sequence), \
106 BOOST_VMD_IS_TYPE_ASSERT_ERROR \
108 /**/
110 #endif // !BOOST_VMD_ASSERT_DATA
112 #endif /* BOOST_PP_VARIADICS */
113 #endif /* BOOST_VMD_ASSERT_IS_TYPE_HPP */