~ubuntu-branches/debian/sid/boost1.49/sid

« back to all changes in this revision

Viewing changes to boost/phoenix/scope/detail/make_locals.hpp

  • Committer: Package Import Robot
  • Author(s): Steve M. Robbins
  • Date: 2012-02-26 00:31:44 UTC
  • Revision ID: package-import@ubuntu.com-20120226003144-eaytp12cbf6ubpms
Tags: upstream-1.49.0
ImportĀ upstreamĀ versionĀ 1.49.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
#if !defined(BOOST_PHOENIX_DONT_USE_PREPROCESSED_FILES)
 
3
#ifndef BOOST_PHOENIX_SCOPE_DETAIL_MAKE_LOCALS_HPP
 
4
#define BOOST_PHOENIX_SCOPE_DETAIL_MAKE_LOCALS_HPP
 
5
 
 
6
#include <boost/phoenix/support/iterate.hpp>
 
7
 
 
8
#include <boost/phoenix/scope/detail/preprocessed/make_locals.hpp>
 
9
 
 
10
#endif
 
11
#else
 
12
 
 
13
#if !BOOST_PHOENIX_IS_ITERATING
 
14
 
 
15
#ifndef BOOST_PHOENIX_SCOPE_DETAIL_MAKE_LOCALS_HPP
 
16
#define BOOST_PHOENIX_SCOPE_DETAIL_MAKE_LOCALS_HPP
 
17
 
 
18
#include <boost/phoenix/support/iterate.hpp>
 
19
 
 
20
#if defined(__WAVE__) && defined(BOOST_PHOENIX_CREATE_PREPROCESSED_FILES)
 
21
#pragma wave option(preserve: 2, line: 0, output: "preprocessed/make_locals_" BOOST_PHOENIX_LIMIT_STR ".hpp")
 
22
#endif
 
23
 
 
24
/*==============================================================================
 
25
    Copyright (c) 2005-2010 Joel de Guzman
 
26
    Copyright (c) 2010 Thomas Heller
 
27
 
 
28
    Distributed under the Boost Software License, Version 1.0. (See accompanying
 
29
    file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
30
==============================================================================*/
 
31
 
 
32
#if defined(__WAVE__) && defined(BOOST_PHOENIX_CREATE_PREPROCESSED_FILES)
 
33
#pragma wave option(preserve: 1)
 
34
#endif
 
35
 
 
36
#define BOOST_PHOENIX_TYPEDEF_LOCAL_TYPES(Z, N, D)                              \
 
37
            typedef                                                             \
 
38
                typename proto::result_of::value<                               \
 
39
                        typename proto::result_of::child_c<                     \
 
40
                            BOOST_PP_CAT(A, N)                                  \
 
41
                          , 0                                                   \
 
42
                        >::type                                                 \
 
43
                >::type                                                         \
 
44
                BOOST_PP_CAT(tag_type, N);                                      \
 
45
                                                                                \
 
46
            typedef                                                             \
 
47
                typename proto::result_of::child_c<                             \
 
48
                    BOOST_PP_CAT(A, N)                                          \
 
49
                  , 1                                                           \
 
50
                >::type                                                         \
 
51
                BOOST_PP_CAT(var_type, N);                                      \
 
52
/**/
 
53
 
 
54
#define BOOST_PHOENIX_TYPEDEF_LOCAL_PAIR_TYPES(Z, N, D)                         \
 
55
    BOOST_PP_COMMA_IF(N)                                                        \
 
56
    fusion::pair<BOOST_PP_CAT(tag_type, N), BOOST_PP_CAT(var_type, N)>          \
 
57
/**/
 
58
 
 
59
#define BOOST_PHOENIX_CHILD_OF(Z, N, D)                                         \
 
60
    BOOST_PP_COMMA_IF(N) proto::child_c<1>(BOOST_PP_CAT(a, N))                  \
 
61
/**/
 
62
 
 
63
 
 
64
#define BOOST_PHOENIX_ITERATION_PARAMS                                          \
 
65
    (3, (1, BOOST_PHOENIX_LOCAL_LIMIT,                                          \
 
66
    <boost/phoenix/scope/detail/make_locals.hpp>))
 
67
#include BOOST_PHOENIX_ITERATE()
 
68
 
 
69
#if defined(__WAVE__) && defined(BOOST_PHOENIX_CREATE_PREPROCESSED_FILES)
 
70
#pragma wave option(output: null)
 
71
#endif
 
72
 
 
73
#endif
 
74
 
 
75
#else
 
76
 
 
77
        template <BOOST_PHOENIX_typename_A>
 
78
        struct make_locals<BOOST_PHOENIX_A>
 
79
        {
 
80
            BOOST_PP_REPEAT(
 
81
                BOOST_PHOENIX_ITERATION
 
82
              , BOOST_PHOENIX_TYPEDEF_LOCAL_TYPES
 
83
              , _
 
84
            )
 
85
            typedef fusion::map<
 
86
                BOOST_PP_REPEAT(
 
87
                    BOOST_PHOENIX_ITERATION
 
88
                  , BOOST_PHOENIX_TYPEDEF_LOCAL_PAIR_TYPES
 
89
                  , _
 
90
                )
 
91
            > type;
 
92
 
 
93
            static type const make(BOOST_PHOENIX_A_a)
 
94
            {
 
95
                return
 
96
                    type(
 
97
                        BOOST_PP_REPEAT(
 
98
                            BOOST_PHOENIX_ITERATION
 
99
                          , BOOST_PHOENIX_CHILD_OF
 
100
                          , _
 
101
                        )
 
102
                    );
 
103
            }
 
104
        };
 
105
 
 
106
#endif
 
107
 
 
108
#endif // BOOST_PHOENIX_DONT_USE_PREPROCESSED_FILES