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_EMPTY_HPP)
8 #define BOOST_VMD_ASSERT_IS_EMPTY_HPP
10 #include <boost/vmd/detail/setup.hpp>
12 #if BOOST_PP_VARIADICS
14 #if BOOST_VMD_ASSERT_DATA
16 #include <boost/vmd/assert.hpp>
17 #include <boost/vmd/is_empty.hpp>
23 The succeeding comments in this file are in doxygen format.
30 /** \def BOOST_VMD_ASSERT_IS_EMPTY(...)
32 \brief Asserts that the input is empty.
34 The macro checks to see if the input is empty or not.
35 If it is not empty, it forces a compiler error.
37 The macro is a variadic macro taking any input.
38 For the VC++8 compiler (VS2005) the macro takes a single parameter of input to check and not variadic data.
40 The macro normally checks for emptiness only in
41 debug mode. However an end-user can force the macro
42 to check or not check by defining the macro
43 BOOST_VMD_ASSERT_DATA to 1 or 0 respectively.
45 .... = variadic input, for VC++8 this must be a single parameter.
47 returns = Normally the macro returns nothing.
49 If the input is empty, nothing is output.
51 For VC++, because there is no sure way of forcing
52 a compiler error from within a macro without producing
53 output, if the input is not empty the
54 macro forces a compiler error by outputting invalid C++.
56 For all other compilers a compiler error is forced
57 without producing output if the input is not empty.
59 It is recommended to append BOOST_PP_EMPTY() to whatever input
60 is being tested in order to avoid possible warning messages
61 from some compilers about no parameters being passed to the macro
62 when the input is truly empty.
68 #if !BOOST_VMD_ASSERT_DATA
70 #define BOOST_VMD_ASSERT_IS_EMPTY(input)
74 #define BOOST_VMD_ASSERT_IS_EMPTY(input) \
77 BOOST_VMD_IS_EMPTY(input), \
78 BOOST_VMD_IS_EMPTY_ASSERT_ERROR \
82 #endif // !BOOST_VMD_ASSERT_DATA
86 #if !BOOST_VMD_ASSERT_DATA
88 #define BOOST_VMD_ASSERT_IS_EMPTY(...)
92 #define BOOST_VMD_ASSERT_IS_EMPTY(...) \
95 BOOST_VMD_IS_EMPTY(__VA_ARGS__), \
96 BOOST_VMD_IS_EMPTY_ASSERT_ERROR \
100 #endif // !BOOST_VMD_ASSERT_DATA
102 #endif /* BOOST_VMD_MSVC_V8 */
104 #endif /* BOOST_PP_VARIADICS */
105 #endif /* BOOST_VMD_ASSERT_IS_EMPTY_HPP */