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_NUMBER_HPP)
8 #define BOOST_VMD_ASSERT_IS_NUMBER_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_NUMBER(sequence)
25 \brief Asserts that the sequence is a number.
27 The macro checks that the parameter is a number.
28 If it is not a number, it forces a compiler error.
30 The macro normally checks for a number 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 number.
39 returns = Normally the macro returns nothing.
41 If the sequence is a number, 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 number 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 #if !BOOST_VMD_ASSERT_DATA
59 #define BOOST_VMD_ASSERT_IS_NUMBER(sequence)
63 #include <boost/vmd/assert.hpp>
64 #include <boost/vmd/is_number.hpp>
66 #define BOOST_VMD_ASSERT_IS_NUMBER(sequence) \
69 BOOST_VMD_IS_NUMBER(sequence), \
70 BOOST_VMD_IS_NUMBER_ASSERT_ERROR \
74 #endif // !BOOST_VMD_ASSERT_DATA
76 #endif /* BOOST_PP_VARIADICS */
77 #endif /* BOOST_VMD_ASSERT_IS_NUMBER_HPP */