File: fold.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 (125 lines) | stat: -rw-r--r-- 6,036 bytes parent folder | download | duplicates (11)
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
<?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/transform/fold.hpp">
  <para>Contains definition of the
    <computeroutput>
      <classname alt="boost::proto::fold">proto::fold&lt;&gt;</classname>
    </computeroutput> and
    <computeroutput>
      <classname alt="boost::proto::reverse_fold">proto::reverse_fold&lt;&gt;</classname>
    </computeroutput>
    transforms.</para>
  <namespace name="boost">
    <namespace name="proto">
      <struct name="fold">
        <template>
          <template-type-parameter name="Sequence"/>
          <template-type-parameter name="State0"/>
          <template-type-parameter name="Fun"/>
        </template>
        <inherit>
          <classname>proto::transform</classname>&lt; fold&lt;Sequence, State0, Fun&gt; &gt;</inherit>
        <purpose>A <conceptname>PrimitiveTransform</conceptname> that invokes the
          <computeroutput>fusion::fold&lt;&gt;</computeroutput> algorithm to accumulate a value.</purpose>
        <description>
          <para>
            For the complete description of the behavior of the <computeroutput>proto::fold&lt;&gt;</computeroutput>
            transform, see the documentation for the nested <computeroutput>
              <classname>proto::fold::impl&lt;&gt;</classname>
            </computeroutput> class template.
          </para>
        </description>
        <struct name="impl">
          <template>
            <template-type-parameter name="Expr"/>
            <template-type-parameter name="State"/>
            <template-type-parameter name="Data"/>
          </template>
          <inherit><classname>proto::transform_impl</classname>&lt; Expr, State, Data &gt;</inherit>
          <typedef name="X">
            <purpose>For exposition only</purpose>
            <type><classname>when</classname>&lt;<classname>_</classname>, Sequence&gt;</type>
          </typedef>
          <typedef name="Y">
            <purpose>For exposition only</purpose>
            <type><classname>when</classname>&lt;<classname>_</classname>, State0&gt;</type>
          </typedef>
          <typedef name="seq">
            <purpose>A Fusion sequence, for exposition only</purpose>
            <type>typename boost::result_of&lt;X(Expr, State, Data)&gt;::type</type>
          </typedef>
          <typedef name="state0">
            <purpose>An initial state for the fold, for exposition only</purpose>
            <type>typename boost::result_of&lt;Y(Expr, State, Data)&gt;::type</type>
          </typedef>
          <typedef name="fun">
            <purpose><computeroutput>fun(d)(s,e) == when&lt;_,Fun&gt;()(e,s,d)</computeroutput></purpose>
            <type><emphasis>unspecified</emphasis></type>
          </typedef>
          <typedef name="result_type">
            <type>typename fusion::result_of::fold&lt;seq, state0, fun&gt;::type</type>
          </typedef>
          <method-group name="public member functions">
            <method name="operator()" cv="const">
              <type>result_type</type>
              <parameter name="expr">
                <paramtype>typename impl::expr_param</paramtype>
                <description>
                  <para>The current expression </para>
                </description>
              </parameter>
              <parameter name="state">
                <paramtype>typename impl::state_param</paramtype>
                <description>
                  <para>The current state </para>
                </description>
              </parameter>
              <parameter name="data">
                <paramtype>typename impl::data_param</paramtype>
                <description>
                  <para>An arbitrary data </para>
                </description>
              </parameter>
              <description>
                <para>
                  Let <computeroutput>seq</computeroutput> be
                  <computeroutput><classname>when</classname>&lt;<classname>_</classname>, Sequence&gt;()(expr, state, data)</computeroutput>,
                  let <computeroutput>state0</computeroutput> be
                  <computeroutput><classname>when</classname>&lt;<classname>_</classname>, State0&gt;()(expr, state, data)</computeroutput>,
                  and let <computeroutput>fun(data)</computeroutput> be an object such that
                  <computeroutput>fun(data)(state, expr)</computeroutput> is equivalent to
                  <computeroutput><classname>when</classname>&lt;<classname>_</classname>, Fun&gt;()(expr, state, data)</computeroutput>. Then,
                  this function returns <computeroutput>fusion::fold(seq, state0, fun(data))</computeroutput>.
                </para>
              </description>
            </method>
          </method-group>
        </struct>
      </struct>

      <struct name="reverse_fold">
        <template>
          <template-type-parameter name="Sequence"/>
          <template-type-parameter name="State0"/>
          <template-type-parameter name="Fun"/>
        </template>
        <inherit><classname>proto::fold</classname>&lt; <classname>proto::_reverse</classname>(Sequence), State0, Fun &gt;</inherit>
        <purpose>
          A <conceptname>PrimitiveTransform</conceptname> that is the same as the <computeroutput><classname>proto::fold&lt;&gt;</classname></computeroutput>
          transform, except that it folds back-to-front instead of front-to-back. It uses the
          <computeroutput>
            <classname>proto::_reverse</classname>
          </computeroutput> callable <conceptname>PolymorphicFunctionObject</conceptname> to create a
          <computeroutput>fusion::reverse_view&lt;&gt;</computeroutput> of the sequence before invoking
          <computeroutput>fusion::fold&lt;&gt;</computeroutput>.
        </purpose>
      </struct>
    </namespace>
  </namespace>
</header>