source: NonGTP/Boost/boost/python/detail/type_list_impl.hpp @ 857

Revision 857, 1.8 KB checked in by igarcia, 18 years ago (diff)
Line 
1#ifndef BOOST_PP_IS_ITERATING
2// Copyright David Abrahams 2002.
3// Distributed under the Boost Software License, Version 1.0. (See
4// accompanying file LICENSE_1_0.txt or copy at
5// http://www.boost.org/LICENSE_1_0.txt)
6# ifndef TYPE_LIST_IMPL_DWA2002913_HPP
7#  define TYPE_LIST_IMPL_DWA2002913_HPP
8
9#  include <boost/python/detail/type_list.hpp>
10
11#  include <boost/preprocessor/enum_params.hpp>
12#  include <boost/preprocessor/enum_params_with_a_default.hpp>
13#  include <boost/preprocessor/repetition/enum.hpp>
14#  include <boost/preprocessor/comma_if.hpp>
15#  include <boost/preprocessor/arithmetic/sub.hpp>
16#  include <boost/preprocessor/iterate.hpp>
17#  include <boost/preprocessor/repetition/enum_trailing.hpp>
18
19namespace boost { namespace python { namespace detail {
20
21template <BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(BOOST_PYTHON_LIST_SIZE, class T, mpl::void_)>
22struct type_list
23    : BOOST_PP_CAT(mpl::vector,BOOST_PYTHON_LIST_SIZE)<BOOST_PP_ENUM_PARAMS_Z(1, BOOST_PYTHON_LIST_SIZE, T)>
24{
25};
26
27#  define BOOST_PP_ITERATION_PARAMS_1                                                                   \
28        (3, (0, BOOST_PP_DEC(BOOST_PYTHON_LIST_SIZE), <boost/python/detail/type_list_impl.hpp>))
29#  include BOOST_PP_ITERATE()
30
31
32}}} // namespace boost::python::detail
33
34# endif // TYPE_LIST_IMPL_DWA2002913_HPP
35
36#else // BOOST_PP_IS_ITERATING
37
38# define N BOOST_PP_ITERATION()
39# define BOOST_PYTHON_VOID_ARGS BOOST_PP_SUB_D(1,BOOST_PYTHON_LIST_SIZE,N)
40
41template <
42    BOOST_PP_ENUM_PARAMS_Z(1, N, class T)
43    >
44struct type_list<
45    BOOST_PP_ENUM_PARAMS_Z(1, N, T)
46    BOOST_PP_COMMA_IF(N)
47    BOOST_PP_ENUM(
48        BOOST_PYTHON_VOID_ARGS, BOOST_PYTHON_FIXED, mpl::void_)
49    >
50   : BOOST_PP_CAT(mpl::vector,N)<BOOST_PP_ENUM_PARAMS_Z(1, N, T)>
51{
52};
53
54# undef BOOST_PYTHON_VOID_ARGS
55# undef N
56
57#endif // BOOST_PP_IS_ITERATING
Note: See TracBrowser for help on using the repository browser.