File: default.xml

package info (click to toggle)
boost1.74 1.74.0-9
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 464,084 kB
  • sloc: cpp: 3,338,324; xml: 131,293; python: 33,088; ansic: 14,336; asm: 4,034; sh: 3,351; makefile: 1,193; perl: 1,036; yacc: 478; php: 212; ruby: 102; lisp: 24; sql: 13; csh: 6
file content (220 lines) | stat: -rw-r--r-- 10,806 bytes parent folder | download | duplicates (13)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright 2012 Eric Niebler

  Distributed under the Boost
  Software License, Version 1.0. (See accompanying
  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  -->
<header name="boost/proto/context/default.hpp">
  <namespace name="boost">
    <namespace name="proto">
      <namespace name="context">
        <struct name="default_eval">
          <template>
            <template-type-parameter name="Expr"/>
            <template-type-parameter name="Context"/>
          </template>
          <purpose>
            A BinaryFunction that accepts a Proto expression and a context, evaluates
            each child expression with the context, and combines the result using the
            standard C++ meaning for the operator represented by the current expression
            node.
          </purpose>
          <description>
            <para>
              Let <computeroutput><computeroutput>OP</computeroutput></computeroutput> be the C++ operator
              corresponding to <computeroutput>Expr::proto_tag</computeroutput>. (For example, if
              <computeroutput>Tag</computeroutput> is <computeroutput>
              <classname>proto::tag::plus</classname></computeroutput>, let <computeroutput>
              <computeroutput>OP</computeroutput></computeroutput> be <computeroutput>+</computeroutput>.)
            </para>
            <para>
              The behavior of this class is specified in terms of the C++0x <computeroutput>decltype</computeroutput>
              keyword. In systems where this keyword is not available, Proto uses the Boost.Typeof library to
              approximate the behavior.
            </para>
          </description>
          <typedef name="Tag">
            <purpose>For exposition only</purpose>
            <type>typename Expr::tag_type</type>
          </typedef>
          <data-member name="s_expr" specifiers="static">
            <purpose>For exposition only</purpose>
            <type>Expr &amp;</type>
          </data-member>
          <data-member name="s_context" specifiers="static">
            <purpose>For exposition only</purpose>
            <type>Context &amp;</type>
          </data-member>
          <typedef name="result_type">
            <type><emphasis>see-below</emphasis></type>
            <description>
              <itemizedlist>
                <listitem>
                  <para>
                    If <computeroutput>Tag</computeroutput> corresponds to a unary prefix operator,
                    then the result type is
                    <programlisting>decltype(
  OP <functionname>proto::eval</functionname>(<functionname>proto::child</functionname>(s_expr), s_context)
)</programlisting>
                  </para>
                </listitem>
                <listitem>
                  <para>
                    If <computeroutput>Tag</computeroutput> corresponds to a unary postfix operator,
                    then the result type is
                    <programlisting>decltype(
  <functionname>proto::eval</functionname>(<functionname>proto::child</functionname>(s_expr), s_context) OP
)</programlisting>
                  </para>
                </listitem>
                <listitem>
                  <para>
                    If <computeroutput>Tag</computeroutput> corresponds to a binary infix operator,
                    then the result type is
                    <programlisting>decltype(
  <functionname>proto::eval</functionname>(<functionname>proto::left</functionname>(s_expr), s_context) OP
  <functionname>proto::eval</functionname>(<functionname>proto::right</functionname>(s_expr), s_context)
)</programlisting>
                  </para>
                </listitem>
                <listitem>
                <para>
                  If <computeroutput>Tag</computeroutput> is <computeroutput>
                    <classname>proto::tag::subscript</classname>
                  </computeroutput>,
                  then the result type is
                  <programlisting>decltype(
  <functionname>proto::eval</functionname>(<functionname>proto::left</functionname>(s_expr), s_context) [
  <functionname>proto::eval</functionname>(<functionname>proto::right</functionname>(s_expr), s_context) ]
)</programlisting>
                </para>
                </listitem>
                <listitem>
                  <para>
                    If <computeroutput>Tag</computeroutput> is <computeroutput>
                      <classname>proto::tag::if_else_</classname>
                    </computeroutput>,
                    then the result type is
                    <programlisting>decltype(
  <functionname>proto::eval</functionname>(<functionname>proto::child_c</functionname>&lt;0&gt;(s_expr), s_context) ?
  <functionname>proto::eval</functionname>(<functionname>proto::child_c</functionname>&lt;1&gt;(s_expr), s_context) :
  <functionname>proto::eval</functionname>(<functionname>proto::child_c</functionname>&lt;2&gt;(s_expr), s_context)
)</programlisting>
                  </para>
                </listitem>
                <listitem>
                  <para>
                    If <computeroutput>Tag</computeroutput> is <computeroutput>
                      <classname>proto::tag::function</classname>
                    </computeroutput>,
                    then the result type is
                    <programlisting>decltype(
  <functionname>proto::eval</functionname>(<functionname>proto::child_c</functionname>&lt;0&gt;(s_expr), s_context) (
  <functionname>proto::eval</functionname>(<functionname>proto::child_c</functionname>&lt;1&gt;(s_expr), s_context),
  ...
  <functionname>proto::eval</functionname>(<functionname>proto::child_c</functionname>&lt;N&gt;(s_expr), s_context) )
)</programlisting>
                  </para>
                </listitem>
              </itemizedlist>
            </description>
          </typedef>
          <method-group name="public member functions">
            <method name="operator()" cv="const">
              <type>result_type</type>
              <parameter name="expr">
                <paramtype>Expr &amp;</paramtype>
                <description>
                  <para>The current expression </para>
                </description>
              </parameter>
              <parameter name="context">
                <paramtype>Context &amp;</paramtype>
                <description>
                  <para>The evaluation context </para>
                </description>
              </parameter>
            <description>
              <itemizedlist>
                <listitem>
                  <para>
                    If <computeroutput>Tag</computeroutput> corresponds to a unary prefix operator,
                    then return
                    <programlisting>OP <functionname>proto::eval</functionname>(<functionname>proto::child</functionname>(expr), context)</programlisting>
                  </para>
                </listitem>
                <listitem>
                  <para>
                    If <computeroutput>Tag</computeroutput> corresponds to a unary postfix operator,
                    then return
                    <programlisting><functionname>proto::eval</functionname>(<functionname>proto::child</functionname>(expr), context) OP</programlisting>
                  </para>
                </listitem>
                <listitem>
                  <para>
                    If <computeroutput>Tag</computeroutput> corresponds to a binary infix operator,
                    then return
                    <programlisting><functionname>proto::eval</functionname>(<functionname>proto::left</functionname>(expr), context) OP
<functionname>proto::eval</functionname>(<functionname>proto::right</functionname>(expr), context)</programlisting>
                  </para>
                </listitem>
                <listitem>
                <para>
                  If <computeroutput>Tag</computeroutput> is <computeroutput>
                    <classname>proto::tag::subscript</classname>
                  </computeroutput>,
                  then return
                  <programlisting><functionname>proto::eval</functionname>(<functionname>proto::left</functionname>(expr), context) [
<functionname>proto::eval</functionname>(<functionname>proto::right</functionname>(expr), context) ]</programlisting>
                </para>
                </listitem>
                <listitem>
                  <para>
                    If <computeroutput>Tag</computeroutput> is <computeroutput>
                      <classname>proto::tag::if_else_</classname>
                    </computeroutput>,
                    then return
                    <programlisting><functionname>proto::eval</functionname>(<functionname>proto::child_c</functionname>&lt;0&gt;(expr), context) ?
<functionname>proto::eval</functionname>(<functionname>proto::child_c</functionname>&lt;1&gt;(expr), context) :
<functionname>proto::eval</functionname>(<functionname>proto::child_c</functionname>&lt;2&gt;(expr), context)</programlisting>
                  </para>
                </listitem>
                <listitem>
                  <para>
                    If <computeroutput>Tag</computeroutput> is <computeroutput>
                      <classname>proto::tag::function</classname>
                    </computeroutput>,
                    then return
                    <programlisting><functionname>proto::eval</functionname>(<functionname>proto::child_c</functionname>&lt;0&gt;(expr), context) (
<functionname>proto::eval</functionname>(<functionname>proto::child_c</functionname>&lt;1&gt;(expr), context),
...
<functionname>proto::eval</functionname>(<functionname>proto::child_c</functionname>&lt;N&gt;(expr), context) )</programlisting>
                  </para>
                </listitem>
              </itemizedlist>
            </description>
            </method>
          </method-group>
        </struct>

        <struct name="default_context">
          <purpose>An evaluation context that gives the operators their normal C++ semantics.</purpose>
          <description>
            <para>An evaluation context that gives the operators their normal C++ semantics.</para>
          </description>
          <struct name="eval">
            <template>
              <template-type-parameter name="Expr"/>
              <template-type-parameter name="ThisContext">
                <default>default_context const</default>
              </template-type-parameter>
            </template>
            <inherit><classname>proto::context::default_eval</classname>&lt; Expr, ThisContext &gt;</inherit>
          </struct>
        </struct>
      </namespace>
    </namespace>
  </namespace>
</header>