Skip to content

Commit eab084c

Browse files
committed
enum export
[SVN r16603]
1 parent 80ea238 commit eab084c

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

doc/v2/enum.html

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,21 @@ <h4><a name="enum_-spec-modifiers"></a>Class template
133133

134134
</dl>
135135

136+
<pre>
137+
inline enum_&lt;T&gt;&amp; export_values();
138+
</pre>
139+
140+
<dl class="function-semantics">
141+
142+
<dt><b>Effects:</b> sets attributes in the current <a
143+
href="scope.html#scope-spec"><code>scope</code></a> with the
144+
same names and values as all enumeration values exposed so far
145+
by calling <code>value()</code></dt>.
146+
147+
<dt><b>Returns:</b> <code>*this</code></dt>
148+
149+
</dl>
150+
136151
<h2><a name="examples"></a>Example(s)</h2>
137152

138153
<p>C++ module definition
@@ -152,6 +167,7 @@ <h2><a name="examples"></a>Example(s)</h2>
152167
enum_&lt;color&gt;(&quot;color&quot;)
153168
.value(&quot;red&quot;, red)
154169
.value(&quot;green&quot;, green)
170+
.export_values()
155171
.value(&quot;blue&quot;, blue)
156172
;
157173

@@ -162,12 +178,23 @@ <h2><a name="examples"></a>Example(s)</h2>
162178
<pre>
163179
&gt;&gt;&gt; from enums import *
164180

181+
&gt;&gt;&gt; identity(red)
182+
enums.color.red
183+
165184
&gt;&gt;&gt; identity(color.red)
166185
enums.color.red
167186

187+
&gt;&gt;&gt; identity(green)
188+
enums.color.green
189+
168190
&gt;&gt;&gt; identity(color.green)
169191
enums.color.green
170192

193+
&gt;&gt;&gt; identity(blue)
194+
Traceback (most recent call last):
195+
File &quot;&lt;stdin&gt;&quot;, line 1, in ?
196+
NameError: name blue' is not defined
197+
171198
&gt;&gt;&gt; identity(color.blue)
172199
enums.color.blue
173200

0 commit comments

Comments
 (0)