~ubuntu-branches/ubuntu/warty/aqsis/warty

« back to all changes in this revision

Viewing changes to boost/boost/mpl/aux_/preprocessor/ext_params.hpp

  • Committer: Bazaar Package Importer
  • Author(s): LaMont Jones
  • Date: 2004-08-24 07:25:04 UTC
  • Revision ID: james.westby@ubuntu.com-20040824072504-zf993vnevvisdsvb
Tags: upstream-0.9.1
ImportĀ upstreamĀ versionĀ 0.9.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//-----------------------------------------------------------------------------
 
2
// boost mpl/aux_/preprocessor/ext_params.hpp header file
 
3
// See http://www.boost.org for updates, documentation, and revision history.
 
4
//-----------------------------------------------------------------------------
 
5
//
 
6
// Copyright (c) 2000-02
 
7
// Aleksey Gurtovoy
 
8
//
 
9
// Permission to use, copy, modify, distribute and sell this software
 
10
// and its documentation for any purpose is hereby granted without fee, 
 
11
// provided that the above copyright notice appears in all copies and 
 
12
// that both the copyright notice and this permission notice appear in 
 
13
// supporting documentation. No representations are made about the 
 
14
// suitability of this software for any purpose. It is provided "as is" 
 
15
// without express or implied warranty.
 
16
 
 
17
#ifndef BOOST_MPL_AUX_PREPROCESSOR_EXT_PARAMS_HPP_INCLUDED
 
18
#define BOOST_MPL_AUX_PREPROCESSOR_EXT_PARAMS_HPP_INCLUDED
 
19
 
 
20
#include "boost/mpl/aux_/config/preprocessor.hpp"
 
21
 
 
22
// BOOST_MPL_PP_EXT_PARAMS(1,1,T): <nothing>
 
23
// BOOST_MPL_PP_EXT_PARAMS(1,2,T): T1
 
24
// BOOST_MPL_PP_EXT_PARAMS(1,3,T): T1, T2
 
25
// BOOST_MPL_PP_EXT_PARAMS(1,n,T): T1, T2, .., Tn-1
 
26
 
 
27
#if !defined(BOOST_MPL_NO_OWN_PP_PRIMITIVES)
 
28
 
 
29
#   include "boost/mpl/aux_/preprocessor/filter_params.hpp"
 
30
#   include "boost/mpl/aux_/preprocessor/sub.hpp"
 
31
 
 
32
#   define BOOST_MPL_PP_EXT_PARAMS(i,j,p) \
 
33
    BOOST_MPL_PP_EXT_PARAMS_DELAY_1(i,BOOST_MPL_PP_SUB(j,i),p) \
 
34
    /**/
 
35
 
 
36
#   define BOOST_MPL_PP_EXT_PARAMS_DELAY_1(i,n,p) \
 
37
    BOOST_MPL_PP_EXT_PARAMS_DELAY_2(i,n,p) \
 
38
    /**/
 
39
 
 
40
#   define BOOST_MPL_PP_EXT_PARAMS_DELAY_2(i,n,p) \
 
41
    BOOST_MPL_PP_EXT_PARAMS_##i(n,p) \
 
42
    /**/
 
43
 
 
44
#   define BOOST_MPL_PP_EXT_PARAMS_1(i,p) BOOST_MPL_PP_FILTER_PARAMS_##i(p##1,p##2,p##3,p##4,p##5,p##6,p##7,p##8,p##9)
 
45
#   define BOOST_MPL_PP_EXT_PARAMS_2(i,p) BOOST_MPL_PP_FILTER_PARAMS_##i(p##2,p##3,p##4,p##5,p##6,p##7,p##8,p##9,p1)
 
46
#   define BOOST_MPL_PP_EXT_PARAMS_3(i,p) BOOST_MPL_PP_FILTER_PARAMS_##i(p##3,p##4,p##5,p##6,p##7,p##8,p##9,p1,p2)
 
47
#   define BOOST_MPL_PP_EXT_PARAMS_4(i,p) BOOST_MPL_PP_FILTER_PARAMS_##i(p##4,p##5,p##6,p##7,p##8,p##9,p1,p2,p3)
 
48
#   define BOOST_MPL_PP_EXT_PARAMS_5(i,p) BOOST_MPL_PP_FILTER_PARAMS_##i(p##5,p##6,p##7,p##8,p##9,p1,p2,p3,p4)
 
49
#   define BOOST_MPL_PP_EXT_PARAMS_6(i,p) BOOST_MPL_PP_FILTER_PARAMS_##i(p##6,p##7,p##8,p##9,p1,p2,p3,p4,p5)
 
50
#   define BOOST_MPL_PP_EXT_PARAMS_7(i,p) BOOST_MPL_PP_FILTER_PARAMS_##i(p##7,p##8,p##9,p1,p2,p3,p4,p5,p6)
 
51
#   define BOOST_MPL_PP_EXT_PARAMS_8(i,p) BOOST_MPL_PP_FILTER_PARAMS_##i(p##8,p##9,p1,p2,p3,p4,p5,p6,p7)
 
52
#   define BOOST_MPL_PP_EXT_PARAMS_9(i,p) BOOST_MPL_PP_FILTER_PARAMS_##i(p##9,p1,p2,p3,p4,p5,p6,p7,p8)
 
53
 
 
54
#else
 
55
 
 
56
#   include "boost/preprocessor/arithmetic/add.hpp"
 
57
#   include "boost/preprocessor/arithmetic/sub.hpp"
 
58
#   include "boost/preprocessor/comma_if.hpp"
 
59
#   include "boost/preprocessor/repeat.hpp"
 
60
#   include "boost/preprocessor/tuple/elem.hpp"
 
61
#   include "boost/preprocessor/cat.hpp"
 
62
 
 
63
#   define BOOST_MPL_PP_AUX_EXT_PARAM_FUNC(unused, i, op) \
 
64
    BOOST_PP_COMMA_IF(i) \
 
65
    BOOST_PP_CAT( \
 
66
          BOOST_PP_TUPLE_ELEM(2,1,op) \
 
67
        , BOOST_PP_ADD_D(1, i, BOOST_PP_TUPLE_ELEM(2,0,op)) \
 
68
        ) \
 
69
    /**/
 
70
 
 
71
#   define BOOST_MPL_PP_EXT_PARAMS(i, j, param) \
 
72
    BOOST_PP_REPEAT_1( \
 
73
          BOOST_PP_SUB_D(1,j,i) \
 
74
        , BOOST_MPL_PP_AUX_EXT_PARAM_FUNC \
 
75
        , (i,param) \
 
76
        ) \
 
77
    /**/
 
78
 
 
79
#endif // BOOST_MPL_NO_OWN_PP_PRIMITIVES
 
80
 
 
81
#endif // BOOST_MPL_AUX_PREPROCESSOR_EXT_PARAMS_HPP_INCLUDED