File: recursive_wrapper.xml

package info (click to toggle)
boost1.35 1.35.0-5
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 203,856 kB
  • ctags: 337,867
  • sloc: cpp: 938,683; xml: 56,847; ansic: 41,589; python: 18,999; sh: 11,566; makefile: 664; perl: 494; yacc: 456; asm: 353; csh: 6
file content (264 lines) | stat: -rw-r--r-- 8,487 bytes parent folder | download | duplicates (7)
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
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE header PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
  "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd">
<header name="boost/variant/recursive_wrapper.hpp">
  <namespace name="boost">

    <class name="recursive_wrapper">
      <purpose>Solves circular dependencies, enabling recursive types.</purpose>

      <template>
        <template-type-parameter name="T"/>
      </template>

      <description>
        <simpara>The <code>recursive_wrapper</code> class template has an
          interface similar to a simple value container, but its content is
          allocated dynamically. This allows <code>recursive_wrapper</code> to
          hold types <code>T</code> whose member data leads to a circular
          dependency (e.g., a data member of <code>T</code> has a data member
          of type <code>T</code>).</simpara>

        <simpara>The application of <code>recursive_wrapper</code> is easiest
          understood in context. See
          <xref linkend="variant.tutorial.recursive.recursive-wrapper"/> for a
          demonstration of a common use of the class template.</simpara>

        <simpara><emphasis role="bold">Notes</emphasis>:</simpara>
        <itemizedlist>
          <listitem>Any type specified as the template argument to
            <code>recursive_wrapper</code> must be capable of construction via
            <code>operator new</code>. Thus, for instance, references are not
            supported.</listitem>
        </itemizedlist>
      </description>

      <typedef name="type">
        <type>T</type>
      </typedef>

      <destructor>
        <purpose>Destructor.</purpose>
        <description>
          <simpara>Deletes the content of <code>*this</code>.</simpara>
        </description>

        <throws>Will not throw.</throws>
      </destructor>

      <constructor>
        <purpose>Default constructor.</purpose>
        <description>
          <simpara>Initializes <code>*this</code> by default construction of
            <code>T</code>.</simpara>
        </description>

        <requires>
          <simpara><code>T</code> must fulfill the requirements of the
            <emphasis>DefaultConstructible</emphasis> [20.1.4]
            concept.</simpara>
        </requires>

        <throws>
          <simpara>May fail with any exceptions arising from the default
            constructor of <code>T</code> or, in the event of
            insufficient memory, with <code>std::bad_alloc</code>.</simpara>
        </throws>
      </constructor>

      <constructor>
        <parameter name="other">
          <paramtype>const recursive_wrapper &amp;</paramtype>
        </parameter>

        <purpose>Copy constructor.</purpose>
        <description>
          <simpara>Copies the content of <code>other</code> into
            <code>*this</code>.</simpara>
        </description>

        <throws>
          <simpara>May fail with any exceptions arising from the
            copy constructor of <code>T</code> or, in the event of
            insufficient memory, with <code>std::bad_alloc</code>.</simpara>
        </throws>
      </constructor>

      <constructor>
        <parameter name="operand">
          <paramtype>const T &amp;</paramtype>
        </parameter>

        <purpose>Value constructor.</purpose>
        <description>
          <simpara>Copies <code>operand</code> into
            <code>*this</code>.</simpara>
        </description>

        <throws>
          <simpara>May fail with any exceptions arising from the
            copy constructor of <code>T</code> or, in the event of
            insufficient memory, with <code>std::bad_alloc</code>.</simpara>
        </throws>
      </constructor>

      <method-group name="modifiers">

        <method name="swap">
          <type>void</type>

          <parameter name="other">
            <paramtype>recursive_wrapper &amp;</paramtype>
          </parameter>

          <description>
            <simpara>Exchanges contents of <code>*this</code> and
              <code>other</code>.</simpara>
          </description>

          <throws>Will not throw.</throws>
        </method>

        <method name="operator=">
          <type>recursive_wrapper &amp;</type>

          <parameter name="rhs">
            <paramtype>const recursive_wrapper &amp;</paramtype>
          </parameter>

          <purpose>Copy assignment operator.</purpose>
          <description>
            <simpara>Assigns the content of <code>rhs</code> to the content of
              <code>*this</code>.</simpara>
          </description>

          <requires>
            <simpara><code>T</code> must fulfill the requirements of
            the <conceptname>Assignable</conceptname>
            concept.</simpara>
          </requires>

          <throws>
            <simpara>May fail with any exceptions arising from the assignment
              operator of <code>T</code>.</simpara>
          </throws>
        </method>

        <method name="operator=">
          <type>recursive_wrapper &amp;</type>

          <parameter name="rhs">
            <paramtype>const T &amp;</paramtype>
          </parameter>

          <purpose>Value assignment operator.</purpose>
          <description>
            <simpara>Assigns <code>rhs</code> into the content of
              <code>*this</code>.</simpara>
          </description>

          <requires>
            <simpara><code>T</code> must fulfill the requirements of the
              <conceptname>Assignable</conceptname>
              concept.</simpara>
          </requires>

          <throws>
            <simpara>May fail with any exceptions arising from the assignment
              operator of <code>T</code>.</simpara>
          </throws>
        </method>

      </method-group>

      <method-group name="queries">

        <overloaded-method name="get">
          <signature>
            <type>T &amp;</type>
          </signature>
          <signature cv="const">
            <type>const T &amp;</type>
          </signature>

          <description>
            <simpara>Returns a reference to the content of
              <code>*this</code>.</simpara>
          </description>

          <throws>Will not throw.</throws>
        </overloaded-method>

        <overloaded-method name="get_pointer">
          <signature>
            <type>T *</type>
          </signature>
          <signature cv="const">
            <type>const T *</type>
          </signature>

          <description>
            <simpara>Returns a pointer to the content of
              <code>*this</code>.</simpara>
          </description>

          <throws>Will not throw.</throws>
        </overloaded-method>

      </method-group>

    </class>
    
    <class name="is_recursive_wrapper">
      <purpose>
        <simpara>Determines whether the specified type is a specialization of
          <code>recursive_wrapper</code>.</simpara>
      </purpose>

      <template>
        <template-type-parameter name="T"/>
      </template>

      <description>
        <simpara>Value is true iff <code>T</code> is a specialization of
          <code><classname>recursive_wrapper</classname></code>.</simpara>
        <simpara><emphasis role="bold">Note</emphasis>:
          <code>is_recursive_wrapper</code> is a model of
          <libraryname>MPL</libraryname>'s
          <emphasis>IntegralConstant</emphasis> concept.</simpara>
      </description>

      <typedef name="type">
        <type><emphasis>unspecified</emphasis></type>
      </typedef>

      <static-constant name="value">
        <type>bool</type>
        <default><emphasis>unspecified</emphasis></default>
      </static-constant>
    </class>

    <class name="unwrap_recursive_wrapper">
      <purpose>
        <simpara>Unwraps the specified argument if given a specialization of
          <code><classname>recursive_wrapper</classname></code>.</simpara>
      </purpose>

      <template>
        <template-type-parameter name="T"/>
      </template>

      <description>
        <simpara><code>type</code> is equivalent to <code>T::type</code> if
          <code>T</code> is a specialization of
          <code><classname>recursive_wrapper</classname></code>. Otherwise,
          <code>type</code> is equivalent to <code>T</code>.</simpara>
      </description>

      <typedef name="type">
        <type><emphasis>unspecified</emphasis></type>
      </typedef>
    </class>

  </namespace>
</header>