1 | |
2 | #ifndef BOOST_MPL_AUX_PREPROCESSOR_IS_SEQ_HPP_INCLUDED |
3 | #define BOOST_MPL_AUX_PREPROCESSOR_IS_SEQ_HPP_INCLUDED |
4 | |
5 | // Copyright Paul Mensonides 2003 |
6 | // Copyright Aleksey Gurtovoy 2003-2004 |
7 | // |
8 | // Distributed under the Boost Software License, Version 1.0. |
9 | // (See accompanying file LICENSE_1_0.txt or copy at |
10 | // http://www.boost.org/LICENSE_1_0.txt) |
11 | // |
12 | // See http://www.boost.org/libs/mpl for documentation. |
13 | |
14 | // $Id$ |
15 | // $Date$ |
16 | // $Revision$ |
17 | |
18 | #include <boost/preprocessor/seq/size.hpp> |
19 | #include <boost/preprocessor/arithmetic/dec.hpp> |
20 | #include <boost/preprocessor/punctuation/paren.hpp> |
21 | #include <boost/preprocessor/cat.hpp> |
22 | #include <boost/preprocessor/config/config.hpp> |
23 | |
24 | // returns 1 if 'seq' is a PP-sequence, 0 otherwise: |
25 | // |
26 | // BOOST_PP_ASSERT( BOOST_PP_NOT( BOOST_MPL_PP_IS_SEQ( int ) ) ) |
27 | // BOOST_PP_ASSERT( BOOST_MPL_PP_IS_SEQ( (int) ) ) |
28 | // BOOST_PP_ASSERT( BOOST_MPL_PP_IS_SEQ( (1)(2) ) ) |
29 | |
30 | #if (BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_BCC()) || defined(_MSC_VER) && defined(__INTEL_COMPILER) && __INTEL_COMPILER == 1010 |
31 | |
32 | # define BOOST_MPL_PP_IS_SEQ(seq) BOOST_PP_DEC( BOOST_PP_SEQ_SIZE( BOOST_MPL_PP_IS_SEQ_(seq) ) ) |
33 | # define BOOST_MPL_PP_IS_SEQ_(seq) BOOST_MPL_PP_IS_SEQ_SEQ_( BOOST_MPL_PP_IS_SEQ_SPLIT_ seq ) |
34 | # define BOOST_MPL_PP_IS_SEQ_SEQ_(x) (x) |
35 | # define BOOST_MPL_PP_IS_SEQ_SPLIT_(unused) unused)((unused) |
36 | |
37 | #else |
38 | |
39 | # if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MWCC() |
40 | # define BOOST_MPL_PP_IS_SEQ(seq) BOOST_MPL_PP_IS_SEQ_MWCC_((seq)) |
41 | # define BOOST_MPL_PP_IS_SEQ_MWCC_(args) BOOST_MPL_PP_IS_SEQ_ ## args |
42 | # else |
43 | # define BOOST_MPL_PP_IS_SEQ(seq) BOOST_MPL_PP_IS_SEQ_(seq) |
44 | # endif |
45 | |
46 | # define BOOST_MPL_PP_IS_SEQ_(seq) BOOST_PP_CAT(BOOST_MPL_PP_IS_SEQ_, BOOST_MPL_PP_IS_SEQ_0 seq BOOST_PP_RPAREN()) |
47 | # define BOOST_MPL_PP_IS_SEQ_0(x) BOOST_MPL_PP_IS_SEQ_1(x |
48 | # define BOOST_MPL_PP_IS_SEQ_ALWAYS_0(unused) 0 |
49 | # define BOOST_MPL_PP_IS_SEQ_BOOST_MPL_PP_IS_SEQ_0 BOOST_MPL_PP_IS_SEQ_ALWAYS_0( |
50 | # define BOOST_MPL_PP_IS_SEQ_BOOST_MPL_PP_IS_SEQ_1(unused) 1 |
51 | |
52 | #endif |
53 | |
54 | #endif // BOOST_MPL_AUX_PREPROCESSOR_IS_SEQ_HPP_INCLUDED |
55 | |