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

« back to all changes in this revision

Viewing changes to boost/boost/mpl/aux_/preprocessor/def_params_tail.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/def_params_tail.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_DEF_PARAMS_TAIL_HPP_INCLUDED
 
18
#define BOOST_MPL_AUX_PREPROCESSOR_DEF_PARAMS_TAIL_HPP_INCLUDED
 
19
 
 
20
#include "boost/mpl/limits/arity.hpp"
 
21
#include "boost/mpl/aux_/config/dtp.hpp"
 
22
#include "boost/mpl/aux_/config/preprocessor.hpp"
 
23
 
 
24
#include "boost/preprocessor/comma_if.hpp"
 
25
#include "boost/preprocessor/logical/and.hpp"
 
26
#include "boost/preprocessor/identity.hpp"
 
27
#include "boost/preprocessor/empty.hpp"
 
28
 
 
29
// BOOST_MPL_PP_DEF_PARAMS_TAIL(1,T): , T1 = void_, .., Tn = void_
 
30
// BOOST_MPL_PP_DEF_PARAMS_TAIL(2,T): , T2 = void_, .., Tn = void_
 
31
// BOOST_MPL_PP_DEF_PARAMS_TAIL(n,T): <nothing>
 
32
 
 
33
#if !defined(BOOST_MPL_NO_OWN_PP_PRIMITIVES)
 
34
 
 
35
#   include "boost/mpl/aux_/preprocessor/filter_params.hpp"
 
36
#   include "boost/mpl/aux_/preprocessor/sub.hpp"
 
37
 
 
38
#   define BOOST_MPL_PP_DEF_PARAMS_TAIL_IMPL(i, param, value_func) \
 
39
    BOOST_MPL_PP_DEF_PARAMS_TAIL_DELAY_1( \
 
40
          i \
 
41
        , BOOST_MPL_PP_SUB(BOOST_MPL_METAFUNCTION_MAX_ARITY,i) \
 
42
        , param \
 
43
        , value_func \
 
44
        ) \
 
45
    /**/
 
46
 
 
47
#   define BOOST_MPL_PP_DEF_PARAMS_TAIL_DELAY_1(i, n, param, value_func) \
 
48
    BOOST_MPL_PP_DEF_PARAMS_TAIL_DELAY_2(i,n,param,value_func) \
 
49
    /**/
 
50
 
 
51
#   define BOOST_MPL_PP_DEF_PARAMS_TAIL_DELAY_2(i, n, param, value_func) \
 
52
    BOOST_PP_COMMA_IF(BOOST_PP_AND(i,n)) \
 
53
    BOOST_MPL_PP_DEF_PARAMS_TAIL_##i(n,param,value_func) \
 
54
    /**/
 
55
 
 
56
#   define BOOST_MPL_PP_DEF_PARAMS_TAIL_0(i,p,v) BOOST_MPL_PP_FILTER_PARAMS_##i(p##1 v(),p##2 v(),p##3 v(),p##4 v(),p##5 v(),p##6 v(),p##7 v(),p##8 v(),p##9 v())
 
57
#   define BOOST_MPL_PP_DEF_PARAMS_TAIL_1(i,p,v) BOOST_MPL_PP_FILTER_PARAMS_##i(p##2 v(),p##3 v(),p##4 v(),p##5 v(),p##6 v(),p##7 v(),p##8 v(),p##9 v(),p1)
 
58
#   define BOOST_MPL_PP_DEF_PARAMS_TAIL_2(i,p,v) BOOST_MPL_PP_FILTER_PARAMS_##i(p##3 v(),p##4 v(),p##5 v(),p##6 v(),p##7 v(),p##8 v(),p##9 v(),p1,p2)
 
59
#   define BOOST_MPL_PP_DEF_PARAMS_TAIL_3(i,p,v) BOOST_MPL_PP_FILTER_PARAMS_##i(p##4 v(),p##5 v(),p##6 v(),p##7 v(),p##8 v(),p##9 v(),p1,p2,p3)
 
60
#   define BOOST_MPL_PP_DEF_PARAMS_TAIL_4(i,p,v) BOOST_MPL_PP_FILTER_PARAMS_##i(p##5 v(),p##6 v(),p##7 v(),p##8 v(),p##9 v(),p1,p2,p3,p4)
 
61
#   define BOOST_MPL_PP_DEF_PARAMS_TAIL_5(i,p,v) BOOST_MPL_PP_FILTER_PARAMS_##i(p##6 v(),p##7 v(),p##8 v(),p##9 v(),p1,p2,p3,p4,p5)
 
62
#   define BOOST_MPL_PP_DEF_PARAMS_TAIL_6(i,p,v) BOOST_MPL_PP_FILTER_PARAMS_##i(p##7 v(),p##8 v(),p##9 v(),p1,p2,p3,p4,p5,p6)
 
63
#   define BOOST_MPL_PP_DEF_PARAMS_TAIL_7(i,p,v) BOOST_MPL_PP_FILTER_PARAMS_##i(p##8 v(),p##9 v(),p1,p2,p3,p4,p5,p6,p7)
 
64
#   define BOOST_MPL_PP_DEF_PARAMS_TAIL_8(i,p,v) BOOST_MPL_PP_FILTER_PARAMS_##i(p##9 v(),p1,p2,p3,p4,p5,p6,p7,p8)
 
65
#   define BOOST_MPL_PP_DEF_PARAMS_TAIL_9(i,p,v) BOOST_MPL_PP_FILTER_PARAMS_##i(p1,p2,p3,p4,p5,p6,p7,p8,p9)
 
66
 
 
67
#else
 
68
 
 
69
#   include "boost/preprocessor/arithmetic/add.hpp"
 
70
#   include "boost/preprocessor/arithmetic/sub.hpp"
 
71
#   include "boost/preprocessor/inc.hpp"
 
72
#   include "boost/preprocessor/tuple/elem.hpp"
 
73
#   include "boost/preprocessor/repeat.hpp"
 
74
#   include "boost/preprocessor/cat.hpp"
 
75
 
 
76
#   define BOOST_MPL_PP_AUX_TAIL_PARAM_FUNC(unused, i, op) \
 
77
    BOOST_PP_COMMA_IF(i) \
 
78
    BOOST_PP_CAT( \
 
79
          BOOST_PP_TUPLE_ELEM(3, 1, op) \
 
80
        , BOOST_PP_ADD_D(1, i, BOOST_PP_INC(BOOST_PP_TUPLE_ELEM(3, 0, op))) \
 
81
        ) BOOST_PP_TUPLE_ELEM(3, 2, op)() \
 
82
    /**/
 
83
 
 
84
#   define BOOST_MPL_PP_DEF_PARAMS_TAIL_IMPL(i, param, value_func) \
 
85
    BOOST_PP_REPEAT_1( \
 
86
          BOOST_PP_SUB_D(1, BOOST_MPL_METAFUNCTION_MAX_ARITY, i) \
 
87
        , BOOST_MPL_PP_AUX_TAIL_PARAM_FUNC \
 
88
        , (i, param, value_func) \
 
89
        ) \
 
90
    /**/
 
91
 
 
92
#endif // BOOST_MPL_NO_OWN_PP_PRIMITIVES
 
93
 
 
94
#define BOOST_MPL_PP_DEF_PARAMS_TAIL(i, param, value) \
 
95
    BOOST_MPL_PP_DEF_PARAMS_TAIL_IMPL(i, param, BOOST_PP_IDENTITY(=value)) \
 
96
    /**/
 
97
 
 
98
#if !defined(BOOST_NO_DEFAULT_TEMPLATE_PARAMETERS_IN_NESTED_TEMPLATES)
 
99
#   define BOOST_MPL_PP_NESTED_DEF_PARAMS_TAIL(i, param, value) \
 
100
    BOOST_MPL_PP_DEF_PARAMS_TAIL_IMPL(i, param, BOOST_PP_IDENTITY(=value)) \
 
101
    /**/
 
102
#else
 
103
#   define BOOST_MPL_PP_NESTED_DEF_PARAMS_TAIL(i, param, value) \
 
104
    BOOST_MPL_PP_DEF_PARAMS_TAIL_IMPL(i, param, BOOST_PP_EMPTY) \
 
105
    /**/
 
106
#endif
 
107
 
 
108
#endif // BOOST_MPL_AUX_PREPROCESSOR_DEF_PARAMS_TAIL_HPP_INCLUDED