summaryrefslogtreecommitdiff
path: root/doc/html/BOOST_TYPE_ERASURE_MEMBER.html
diff options
context:
space:
mode:
Diffstat (limited to 'doc/html/BOOST_TYPE_ERASURE_MEMBER.html')
-rw-r--r--doc/html/BOOST_TYPE_ERASURE_MEMBER.html43
1 files changed, 23 insertions, 20 deletions
diff --git a/doc/html/BOOST_TYPE_ERASURE_MEMBER.html b/doc/html/BOOST_TYPE_ERASURE_MEMBER.html
index dce1f5cc70..5483d37fb1 100644
--- a/doc/html/BOOST_TYPE_ERASURE_MEMBER.html
+++ b/doc/html/BOOST_TYPE_ERASURE_MEMBER.html
@@ -32,29 +32,36 @@
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="boost_typeerasure/reference.html#header.boost.type_erasure.member_hpp" title="Header &lt;boost/type_erasure/member.hpp&gt;">boost/type_erasure/member.hpp</a>&gt;
-</span>BOOST_TYPE_ERASURE_MEMBER(qualified_name, member, N)</pre></div>
+</span>BOOST_TYPE_ERASURE_MEMBER(concept_name, member)</pre></div>
<div class="refsect1">
<a name="id-1.3.41.13.24.3.4"></a><h2>Description</h2>
<p>
The declaration of the concept is </p>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">Sig</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T</span> <span class="special">=</span> <span class="identifier">_self</span><span class="special">&gt;</span>
-<span class="keyword">struct</span> <span class="special">::</span><span class="identifier">namespace1</span><span class="special">::</span><span class="identifier">namespace2</span><span class="special">::</span><span class="special">...</span><span class="special">::</span><span class="identifier">concept_name</span><span class="special">;</span>
+<span class="keyword">struct</span> <span class="identifier">concept_name</span><span class="special">;</span>
+</pre>
+<p> where <code class="computeroutput">Sig</code> is a function type giving the signature of the member function, and <code class="computeroutput">T</code> is the object type. <code class="computeroutput">T</code> may be const-qualified for const member functions. <code class="computeroutput">concept_name&lt;R(A...) const, T&gt;</code> is an alias for <code class="computeroutput">concept_name&lt;R(A...), const T&gt;</code>.</p>
+<p>This macro can only be used at namespace scope.</p>
+<p>Example:</p>
+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span>
+<span class="identifier">BOOST_TYPE_ERASURE_MEMBER</span><span class="special">(</span><span class="identifier">push_back</span><span class="special">)</span>
+<span class="special">}</span>
+<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_push_back</span><span class="special">&lt;</span><span class="keyword">void</span><span class="special">(</span><span class="keyword">int</span><span class="special">)</span><span class="special">&gt;</span> <span class="identifier">push_back_concept</span><span class="special">;</span>
+</pre>
+<p>The concept defined by this function may be specialized to provide a concept_map. The class object will be passed by reference as the first parameter.</p>
+<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="special">&gt;</span>
+<span class="keyword">struct</span> <span class="identifier">has_push_back</span><span class="special">&lt;</span><span class="keyword">void</span><span class="special">(</span><span class="keyword">int</span><span class="special">)</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">list</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">&gt;</span> <span class="special">&gt;</span> <span class="special">{</span>
+ <span class="keyword">static</span> <span class="keyword">void</span> <span class="identifier">apply</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">list</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">&gt;</span><span class="special">&amp;</span> <span class="identifier">l</span><span class="special">,</span> <span class="keyword">int</span> <span class="identifier">i</span><span class="special">)</span> <span class="special">{</span> <span class="identifier">l</span><span class="special">.</span><span class="identifier">push_back</span><span class="special">(</span><span class="identifier">i</span><span class="special">)</span><span class="special">;</span> <span class="special">}</span>
+<span class="special">}</span><span class="special">;</span>
+</pre>
+<p>In C++03, the macro can only be used in the global namespace and is defined as:</p>
+<pre class="programlisting"><span class="preprocessor">#define</span> <span class="identifier">BOOST_TYPE_ERASURE_MEMBER</span><span class="special">(</span><span class="identifier">qualified_name</span><span class="special">,</span> <span class="identifier">member</span><span class="special">,</span> <span class="identifier">N</span><span class="special">)</span>
</pre>
-<p> where Sig is a function type giving the signature of the member function, and T is the object type. T may be const-qualified for const member functions.</p>
-<p>This macro can only be used in the global namespace.</p>
<p>Example:</p>
<pre class="programlisting"><span class="identifier">BOOST_TYPE_ERASURE_MEMBER</span><span class="special">(</span><span class="special">(</span><span class="identifier">boost</span><span class="special">)</span><span class="special">(</span><span class="identifier">has_push_back</span><span class="special">)</span><span class="special">,</span> <span class="identifier">push_back</span><span class="special">,</span> <span class="number">1</span><span class="special">)</span>
<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">has_push_back</span><span class="special">&lt;</span><span class="keyword">void</span><span class="special">(</span><span class="keyword">int</span><span class="special">)</span><span class="special">,</span> <span class="identifier">_self</span><span class="special">&gt;</span> <span class="identifier">push_back_concept</span><span class="special">;</span>
</pre>
-<div class="note"><table border="0" summary="Note">
-<tr>
-<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../doc/src/images/note.png"></td>
-<th align="left">Note</th>
-</tr>
-<tr><td align="left" valign="top"><p>In C++11 the argument N is ignored and may be omitted. BOOST_TYPE_ERASURE_MEMBER will always define a variadic concept. </p></td></tr>
-</table></div>
-<p>
-</p>
+<p>For backwards compatibility, this form is always accepted. </p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
@@ -69,16 +76,12 @@ The declaration of the concept is </p>
</colgroup>
<tbody>
<tr>
-<td><p><span class="term"><code class="computeroutput">N</code></span></p></td>
-<td><p>is the number of arguments of the function.</p></td>
+<td><p><span class="term"><code class="computeroutput">concept_name</code></span></p></td>
+<td><p>is the name of the concept to declare. If it is omitted it defaults to <code class="computeroutput">has_ ## member</code> </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">member</code></span></p></td>
-<td><p>is the name of the member function. </p></td>
-</tr>
-<tr>
-<td><p><span class="term"><code class="computeroutput">qualified_name</code></span></p></td>
-<td><p>should be a preprocessor sequence of the form (namespace1)(namespace2)...(concept_name). </p></td>
+<td><p>is the name of the member function.</p></td>
</tr>
</tbody>
</table></div></td>