1
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).
6
7#if !defined(BOOST_VMD_ASSERT_IS_TUPLE_HPP)
8#define BOOST_VMD_ASSERT_IS_TUPLE_HPP
9
10#include <boost/vmd/detail/setup.hpp>
11
12#if BOOST_PP_VARIADICS
13
14/*
15
16 The succeeding comments in this file are in doxygen format.
17
18*/
19
20/** \file
21*/
22
23/** \def BOOST_VMD_ASSERT_IS_TUPLE(sequence)
24
25 \brief Asserts that the sequence is a Boost PP tuple.
26
27 The macro checks that the sequence is a Boost PP tuple.
28 If it is not a Boost PP tuple, it forces a compiler error.
29
30 The macro normally checks for a Boost PP tuple 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.
34
35 sequence = a possible Boost PP tuple.
36
37 returns = Normally the macro returns nothing.
38
39 If the sequence is a Boost PP tuple, nothing is
40 output.
41
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 tuple the
45 macro forces a compiler error by outputting invalid C++.
46
47 For all other compilers a compiler error is forced
48 without producing output if the sequence is not a
49 Boost PP tuple.
50
51*/
52
53#if !BOOST_VMD_ASSERT_DATA
54
55#define BOOST_VMD_ASSERT_IS_TUPLE(sequence)
56
57#else
58
59#include <boost/vmd/assert.hpp>
60#include <boost/vmd/is_tuple.hpp>
61
62#define BOOST_VMD_ASSERT_IS_TUPLE(sequence) \
63 BOOST_VMD_ASSERT \
64 ( \
65 BOOST_VMD_IS_TUPLE(sequence), \
66 BOOST_VMD_ASSERT_IS_TUPLE_ERROR \
67 ) \
68/**/
69
70#endif /* BOOST_VMD_ASSERT_DATA */
71
72#endif /* BOOST_PP_VARIADICS */
73#endif /* BOOST_VMD_ASSERT_IS_TUPLE_HPP */
74

source code of boost/boost/vmd/assert_is_tuple.hpp