forked from boostorg/fusion
adding fusion docs and tests
[SVN r34920]
This commit is contained in:
164
doc/html/fusion/support/category_of.html
Normal file
164
doc/html/fusion/support/category_of.html
Normal file
@ -0,0 +1,164 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<title>category_of</title>
|
||||
<link rel="stylesheet" href="../../boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.66.1">
|
||||
<link rel="start" href="../../index.html" title="Chapter<65>1.<2E>Fusion 2.0">
|
||||
<link rel="up" href="../support.html" title="Support">
|
||||
<link rel="prev" href="tag_of.html" title="tag_of">
|
||||
<link rel="next" href="pair.html" title="pair">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
<table cellpadding="2" width="100%">
|
||||
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
|
||||
<td align="center"><a href="../../../../../../index.htm">Home</a></td>
|
||||
<td align="center"><a href="../../../../../libraries.htm">Libraries</a></td>
|
||||
<td align="center"><a href="../../../../../../people/people.htm">People</a></td>
|
||||
<td align="center"><a href="../../../../../../more/faq.htm">FAQ</a></td>
|
||||
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
|
||||
</table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="tag_of.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../support.html"><img src="../../images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../images/home.png" alt="Home"></a><a accesskey="n" href="pair.html"><img src="../../images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
<div class="section" lang="en">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
<a name="fusion.support.category_of"></a><a href="category_of.html" title="category_of">category_of</a></h3></div></div></div>
|
||||
<a name="fusion.support.category_of.description"></a><h4>
|
||||
<a name="id449078"></a>
|
||||
<a href="category_of.html#fusion.support.category_of.description">Description</a>
|
||||
</h4>
|
||||
<p>
|
||||
A metafunction that establishes the conceptual classification of a particular
|
||||
<a href="../sequences.html" title="Sequences">Sequence</a> or <a href="../iterators.html" title="Iterators">Iterator</a>
|
||||
(see <a href="../iterators/concepts.html" title="Concepts">Iterator Concepts</a> and
|
||||
<a href="../sequences/concepts.html" title="Concepts">Sequence Concepts</a>).
|
||||
</p>
|
||||
<a name="fusion.support.category_of.synopsis"></a><h4>
|
||||
<a name="id449143"></a>
|
||||
<a href="category_of.html#fusion.support.category_of.synopsis">Synopsis</a>
|
||||
</h4>
|
||||
<pre class="programlisting">
|
||||
<span class="keyword">namespace</span> <span class="identifier">traits</span>
|
||||
<span class="special">{</span>
|
||||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">></span>
|
||||
<span class="keyword">struct</span> <span class="identifier">category_of</span>
|
||||
<span class="special">{</span>
|
||||
<span class="keyword">typedef</span> <span class="emphasis"><em>unspecified</em></span> <span class="identifier">type</span><span class="special">;</span>
|
||||
<span class="special">};</span>
|
||||
<span class="special">}</span>
|
||||
</pre>
|
||||
<a name="fusion.support.category_of.parameters"></a><h4>
|
||||
<a name="id449273"></a>
|
||||
<a href="category_of.html#fusion.support.category_of.parameters">Parameters</a>
|
||||
</h4>
|
||||
<div class="informaltable">
|
||||
<h4>
|
||||
<a name="id449294"></a>
|
||||
</h4>
|
||||
<table class="table">
|
||||
<colgroup>
|
||||
<col>
|
||||
<col>
|
||||
<col>
|
||||
</colgroup>
|
||||
<thead><tr>
|
||||
<th>Parameter</th>
|
||||
<th>Requirement</th>
|
||||
<th>Description</th>
|
||||
</tr></thead>
|
||||
<tbody><tr>
|
||||
<td><tt class="computeroutput"><span class="identifier">T</span></tt></td>
|
||||
<td>Any
|
||||
type</td>
|
||||
<td>The type to query.</td>
|
||||
</tr></tbody>
|
||||
</table>
|
||||
</div>
|
||||
<a name="fusion.support.category_of.expression_semantics"></a><h4>
|
||||
<a name="id449356"></a>
|
||||
<a href="category_of.html#fusion.support.category_of.expression_semantics">Expression
|
||||
Semantics</a>
|
||||
</h4>
|
||||
<pre class="programlisting">
|
||||
<span class="keyword">typedef</span> <span class="identifier">traits</span><span class="special">::</span><span class="identifier">category_of</span><span class="special"><</span><span class="identifier">T</span><span class="special">>::</span><span class="identifier">type</span> <span class="identifier">category</span><span class="special">;</span>
|
||||
</pre>
|
||||
<p>
|
||||
<span class="bold"><b>Return type</b></span>:
|
||||
</p>
|
||||
<p>
|
||||
For Iterators, the return type is derived from one of:
|
||||
</p>
|
||||
<pre class="programlisting">
|
||||
<span class="keyword">struct</span> <span class="identifier">incrementable_traversal_tag</span> <span class="special">{};</span>
|
||||
|
||||
<span class="keyword">struct</span> <span class="identifier">single_pass_traversal_tag</span>
|
||||
<span class="special">:</span> <span class="identifier">incrementable_traversal_tag</span> <span class="special">{};</span>
|
||||
|
||||
<span class="keyword">struct</span> <span class="identifier">forward_traversal_tag</span>
|
||||
<span class="special">:</span> <span class="identifier">single_pass_traversal_tag</span> <span class="special">{};</span>
|
||||
|
||||
<span class="keyword">struct</span> <span class="identifier">bidirectional_traversal_tag</span>
|
||||
<span class="special">:</span> <span class="identifier">forward_traversal_tag</span> <span class="special">{};</span>
|
||||
|
||||
<span class="keyword">struct</span> <span class="identifier">random_access_traversal_tag</span>
|
||||
<span class="special">:</span> <span class="identifier">bidirectional_traversal_tag</span> <span class="special">{};</span>
|
||||
</pre>
|
||||
<p>
|
||||
For Sequences, the return type is derived from one of:
|
||||
</p>
|
||||
<pre class="programlisting">
|
||||
<span class="keyword">struct</span> <span class="identifier">incrementable_sequence_tag</span> <span class="special">{};</span>
|
||||
|
||||
<span class="keyword">struct</span> <span class="identifier">single_pass_sequence_tag</span>
|
||||
<span class="special">:</span> <span class="identifier">incrementable_sequence_tag</span> <span class="special">{};</span>
|
||||
|
||||
<span class="keyword">struct</span> <span class="identifier">forward_sequence_tag</span>
|
||||
<span class="special">:</span> <span class="identifier">single_pass_sequence_tag</span> <span class="special">{};</span>
|
||||
|
||||
<span class="keyword">struct</span> <span class="identifier">bidirectional_sequence_tag</span>
|
||||
<span class="special">:</span> <span class="identifier">forward_sequence_tag</span> <span class="special">{};</span>
|
||||
|
||||
<span class="keyword">struct</span> <span class="identifier">random_access_sequence_tag</span>
|
||||
<span class="special">:</span> <span class="identifier">bidirectional_sequence_tag</span> <span class="special">{};</span>
|
||||
</pre>
|
||||
<p>
|
||||
And optionally from:
|
||||
</p>
|
||||
<pre class="programlisting">
|
||||
<span class="keyword">struct</span> <span class="identifier">associative_sequence_tag</span> <span class="special">{};</span>
|
||||
</pre>
|
||||
<p>
|
||||
<span class="bold"><b>Semantics</b></span>: Establishes the conceptual classification
|
||||
of a particular <a href="../sequences.html" title="Sequences">Sequence</a> or <a href="../iterators.html" title="Iterators">Iterator</a>.
|
||||
</p>
|
||||
<a name="fusion.support.category_of.header"></a><h4>
|
||||
<a name="id449813"></a>
|
||||
<a href="category_of.html#fusion.support.category_of.header">Header</a>
|
||||
</h4>
|
||||
<pre class="programlisting">
|
||||
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">fusion</span><span class="special">/</span><span class="identifier">support</span><span class="special">/</span><span class="identifier">category_of</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
|
||||
</pre>
|
||||
<a name="fusion.support.category_of.example"></a><h4>
|
||||
<a name="id449906"></a>
|
||||
<a href="category_of.html#fusion.support.category_of.example">Example</a>
|
||||
</h4>
|
||||
<pre class="programlisting">
|
||||
<span class="keyword">using</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">is_base_of</span><span class="special">;</span>
|
||||
<span class="keyword">typedef</span> <span class="identifier">traits</span><span class="special">::</span><span class="identifier">category_of</span><span class="special"><</span><a href="../sequences/containers/list.html" title="list"><tt class="computeroutput"><span class="identifier">list</span></tt></a><span class="special"><></span> <span class="special">>::</span><span class="identifier">type</span> <span class="identifier">list_category</span><span class="special">;</span>
|
||||
<span class="keyword">typedef</span> <span class="identifier">traits</span><span class="special">::</span><span class="identifier">category_of</span><span class="special"><</span><a href="../sequences/containers/vector.html" title="vector"><tt class="computeroutput"><span class="identifier">vector</span></tt></a><span class="special"><></span> <span class="special">>::</span><span class="identifier">type</span> <span class="identifier">vector_category</span><span class="special">;</span>
|
||||
<span class="identifier">BOOST_MPL_ASSERT</span><span class="special">((</span> <span class="identifier">is_base_of</span><span class="special"><</span><span class="identifier">forward_sequence_tag</span><span class="special">,</span> <span class="identifier">list_category</span><span class="special">></span> <span class="special">));</span>
|
||||
<span class="identifier">BOOST_MPL_ASSERT</span><span class="special">((</span> <span class="identifier">is_base_of</span><span class="special"><</span><span class="identifier">random_access_sequence_tag</span><span class="special">,</span> <span class="identifier">vector_category</span><span class="special">></span> <span class="special">));</span>
|
||||
</pre>
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><small>Copyright <20> 2001-2005 Joel de Guzman, Dan Marsden</small></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="tag_of.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../support.html"><img src="../../images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../images/home.png" alt="Home"></a><a accesskey="n" href="pair.html"><img src="../../images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
126
doc/html/fusion/support/is_sequence.html
Normal file
126
doc/html/fusion/support/is_sequence.html
Normal file
@ -0,0 +1,126 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<title>is_sequence</title>
|
||||
<link rel="stylesheet" href="../../boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.66.1">
|
||||
<link rel="start" href="../../index.html" title="Chapter<65>1.<2E>Fusion 2.0">
|
||||
<link rel="up" href="../support.html" title="Support">
|
||||
<link rel="prev" href="../support.html" title="Support">
|
||||
<link rel="next" href="is_view.html" title="is_view">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
<table cellpadding="2" width="100%">
|
||||
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
|
||||
<td align="center"><a href="../../../../../../index.htm">Home</a></td>
|
||||
<td align="center"><a href="../../../../../libraries.htm">Libraries</a></td>
|
||||
<td align="center"><a href="../../../../../../people/people.htm">People</a></td>
|
||||
<td align="center"><a href="../../../../../../more/faq.htm">FAQ</a></td>
|
||||
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
|
||||
</table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="../support.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../support.html"><img src="../../images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../images/home.png" alt="Home"></a><a accesskey="n" href="is_view.html"><img src="../../images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
<div class="section" lang="en">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
<a name="fusion.support.is_sequence"></a><a href="is_sequence.html" title="is_sequence">is_sequence</a></h3></div></div></div>
|
||||
<a name="fusion.support.is_sequence.description"></a><h4>
|
||||
<a name="id446159"></a>
|
||||
<a href="is_sequence.html#fusion.support.is_sequence.description">Description</a>
|
||||
</h4>
|
||||
<p>
|
||||
Metafunction that evaluates to <tt class="computeroutput"><span class="identifier">mpl</span><span class="special">::</span><span class="identifier">true_</span></tt>
|
||||
if a certain type <tt class="computeroutput"><span class="identifier">T</span></tt> is a
|
||||
conforming Fusion <a href="../sequences.html" title="Sequences">Sequence</a>, <tt class="computeroutput"><span class="identifier">mpl</span><span class="special">::</span><span class="identifier">false_</span></tt>
|
||||
otherwise. This may be specialized to accomodate clients which provide Fusion
|
||||
conforming sequences.
|
||||
</p>
|
||||
<a name="fusion.support.is_sequence.synopsis"></a><h4>
|
||||
<a name="id446248"></a>
|
||||
<a href="is_sequence.html#fusion.support.is_sequence.synopsis">Synopsis</a>
|
||||
</h4>
|
||||
<pre class="programlisting">
|
||||
<span class="keyword">namespace</span> <span class="identifier">traits</span>
|
||||
<span class="special">{</span>
|
||||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">></span>
|
||||
<span class="keyword">struct</span> <span class="identifier">is_sequence</span>
|
||||
<span class="special">{</span>
|
||||
<span class="keyword">typedef</span> <span class="emphasis"><em>unspecified</em></span> <span class="identifier">type</span><span class="special">;</span>
|
||||
<span class="special">};</span>
|
||||
<span class="special">}</span>
|
||||
</pre>
|
||||
<a name="fusion.support.is_sequence.parameters"></a><h4>
|
||||
<a name="id446378"></a>
|
||||
<a href="is_sequence.html#fusion.support.is_sequence.parameters">Parameters</a>
|
||||
</h4>
|
||||
<div class="informaltable">
|
||||
<h4>
|
||||
<a name="id446399"></a>
|
||||
</h4>
|
||||
<table class="table">
|
||||
<colgroup>
|
||||
<col>
|
||||
<col>
|
||||
<col>
|
||||
</colgroup>
|
||||
<thead><tr>
|
||||
<th>Parameter</th>
|
||||
<th>Requirement</th>
|
||||
<th>Description</th>
|
||||
</tr></thead>
|
||||
<tbody><tr>
|
||||
<td><tt class="computeroutput"><span class="identifier">T</span></tt></td>
|
||||
<td>Any
|
||||
type</td>
|
||||
<td>The type to query.</td>
|
||||
</tr></tbody>
|
||||
</table>
|
||||
</div>
|
||||
<a name="fusion.support.is_sequence.expression_semantics"></a><h4>
|
||||
<a name="id446462"></a>
|
||||
<a href="is_sequence.html#fusion.support.is_sequence.expression_semantics">Expression
|
||||
Semantics</a>
|
||||
</h4>
|
||||
<pre class="programlisting">
|
||||
<span class="keyword">typedef</span> <span class="identifier">traits</span><span class="special">::</span><span class="identifier">is_sequence</span><span class="special"><</span><span class="identifier">T</span><span class="special">>::</span><span class="identifier">type</span> <span class="identifier">c</span><span class="special">;</span>
|
||||
</pre>
|
||||
<p>
|
||||
<span class="bold"><b>Return type</b></span>: An MPL Boolean Constant.
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><b>Semantics</b></span>: Metafunction that evaluates to
|
||||
<tt class="computeroutput"><span class="identifier">mpl</span><span class="special">::</span><span class="identifier">true_</span></tt> if a certain type <tt class="computeroutput"><span class="identifier">T</span></tt>
|
||||
is a conforming Fusion sequence, <tt class="computeroutput"><span class="identifier">mpl</span><span class="special">::</span><span class="identifier">false_</span></tt>
|
||||
otherwise.
|
||||
</p>
|
||||
<a name="fusion.support.is_sequence.header"></a><h4>
|
||||
<a name="id446618"></a>
|
||||
<a href="is_sequence.html#fusion.support.is_sequence.header">Header</a>
|
||||
</h4>
|
||||
<pre class="programlisting">
|
||||
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">fusion</span><span class="special">/</span><span class="identifier">support</span><span class="special">/</span><span class="identifier">is_sequence</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
|
||||
</pre>
|
||||
<a name="fusion.support.is_sequence.example"></a><h4>
|
||||
<a name="id446710"></a>
|
||||
<a href="is_sequence.html#fusion.support.is_sequence.example">Example</a>
|
||||
</h4>
|
||||
<pre class="programlisting">
|
||||
<span class="identifier">BOOST_MPL_ASSERT_NOT</span><span class="special">((</span> <span class="identifier">traits</span><span class="special">::</span><span class="identifier">is_sequence</span><span class="special"><</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special"><</span><span class="keyword">int</span><span class="special">></span> <span class="special">></span> <span class="special">));</span>
|
||||
<span class="identifier">BOOST_MPL_ASSERT_NOT</span><span class="special">((</span> <span class="identifier">is_sequence</span><span class="special"><</span> <span class="keyword">int</span> <span class="special">></span> <span class="special">));</span>
|
||||
<span class="identifier">BOOST_MPL_ASSERT</span><span class="special">((</span> <span class="identifier">traits</span><span class="special">::</span><span class="identifier">is_sequence</span><span class="special"><</span><a href="../sequences/containers/list.html" title="list"><tt class="computeroutput"><span class="identifier">list</span></tt></a><span class="special"><></span> <span class="special">></span> <span class="special">));</span>
|
||||
<span class="identifier">BOOST_MPL_ASSERT</span><span class="special">((</span> <span class="identifier">traits</span><span class="special">::</span><span class="identifier">is_sequence</span><span class="special"><</span><a href="../sequences/containers/list.html" title="list"><tt class="computeroutput"><span class="identifier">list</span></tt></a><span class="special"><</span><span class="keyword">int</span><span class="special">></span> <span class="special">></span> <span class="special">));</span>
|
||||
<span class="identifier">BOOST_MPL_ASSERT</span><span class="special">((</span> <span class="identifier">traits</span><span class="special">::</span><span class="identifier">is_sequence</span><span class="special"><</span><a href="../sequences/containers/vector.html" title="vector"><tt class="computeroutput"><span class="identifier">vector</span></tt></a><span class="special"><></span> <span class="special">></span> <span class="special">));</span>
|
||||
<span class="identifier">BOOST_MPL_ASSERT</span><span class="special">((</span> <span class="identifier">traits</span><span class="special">::</span><span class="identifier">is_sequence</span><span class="special"><</span><a href="../sequences/containers/vector.html" title="vector"><tt class="computeroutput"><span class="identifier">vector</span></tt></a><span class="special"><</span><span class="keyword">int</span><span class="special">></span> <span class="special">></span> <span class="special">));</span>
|
||||
</pre>
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><small>Copyright <20> 2001-2005 Joel de Guzman, Dan Marsden</small></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="../support.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../support.html"><img src="../../images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../images/home.png" alt="Home"></a><a accesskey="n" href="is_view.html"><img src="../../images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
130
doc/html/fusion/support/is_view.html
Normal file
130
doc/html/fusion/support/is_view.html
Normal file
@ -0,0 +1,130 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<title>is_view</title>
|
||||
<link rel="stylesheet" href="../../boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.66.1">
|
||||
<link rel="start" href="../../index.html" title="Chapter<65>1.<2E>Fusion 2.0">
|
||||
<link rel="up" href="../support.html" title="Support">
|
||||
<link rel="prev" href="is_sequence.html" title="is_sequence">
|
||||
<link rel="next" href="tag_of.html" title="tag_of">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
<table cellpadding="2" width="100%">
|
||||
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
|
||||
<td align="center"><a href="../../../../../../index.htm">Home</a></td>
|
||||
<td align="center"><a href="../../../../../libraries.htm">Libraries</a></td>
|
||||
<td align="center"><a href="../../../../../../people/people.htm">People</a></td>
|
||||
<td align="center"><a href="../../../../../../more/faq.htm">FAQ</a></td>
|
||||
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
|
||||
</table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="is_sequence.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../support.html"><img src="../../images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../images/home.png" alt="Home"></a><a accesskey="n" href="tag_of.html"><img src="../../images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
<div class="section" lang="en">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
<a name="fusion.support.is_view"></a><a href="is_view.html" title="is_view">is_view</a></h3></div></div></div>
|
||||
<a name="fusion.support.is_view.description"></a><h4>
|
||||
<a name="id447156"></a>
|
||||
<a href="is_view.html#fusion.support.is_view.description">Description</a>
|
||||
</h4>
|
||||
<p>
|
||||
Metafunction that evaluates to <tt class="computeroutput"><span class="identifier">mpl</span><span class="special">::</span><span class="identifier">true_</span></tt>
|
||||
if a certain type <tt class="computeroutput"><span class="identifier">T</span></tt> is a
|
||||
conforming Fusion <a href="../sequences/views.html" title="Views">View</a>, <tt class="computeroutput"><span class="identifier">mpl</span><span class="special">::</span><span class="identifier">false_</span></tt>
|
||||
otherwise. A view is a specialized sequence that does not actually contain
|
||||
data. Views hold sequences which may be other views. In general, views are
|
||||
held by other views by value, while non-views are held by other views by
|
||||
reference. <tt class="computeroutput"><span class="identifier">is_view</span></tt> may be
|
||||
specialized to accomodate clients providing Fusion conforming views.
|
||||
</p>
|
||||
<a name="fusion.support.is_view.synopsis"></a><h4>
|
||||
<a name="id447257"></a>
|
||||
<a href="is_view.html#fusion.support.is_view.synopsis">Synopsis</a>
|
||||
</h4>
|
||||
<pre class="programlisting">
|
||||
<span class="keyword">namespace</span> <span class="identifier">traits</span>
|
||||
<span class="special">{</span>
|
||||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">></span>
|
||||
<span class="keyword">struct</span> <span class="identifier">is_view</span>
|
||||
<span class="special">{</span>
|
||||
<span class="keyword">typedef</span> <span class="emphasis"><em>unspecified</em></span> <span class="identifier">type</span><span class="special">;</span>
|
||||
<span class="special">};</span>
|
||||
<span class="special">}</span>
|
||||
</pre>
|
||||
<a name="fusion.support.is_view.parameters"></a><h4>
|
||||
<a name="id447386"></a>
|
||||
<a href="is_view.html#fusion.support.is_view.parameters">Parameters</a>
|
||||
</h4>
|
||||
<div class="informaltable">
|
||||
<h4>
|
||||
<a name="id447407"></a>
|
||||
</h4>
|
||||
<table class="table">
|
||||
<colgroup>
|
||||
<col>
|
||||
<col>
|
||||
<col>
|
||||
</colgroup>
|
||||
<thead><tr>
|
||||
<th>Parameter</th>
|
||||
<th>Requirement</th>
|
||||
<th>Description</th>
|
||||
</tr></thead>
|
||||
<tbody><tr>
|
||||
<td><tt class="computeroutput"><span class="identifier">T</span></tt></td>
|
||||
<td>Any
|
||||
type</td>
|
||||
<td>The type to query.</td>
|
||||
</tr></tbody>
|
||||
</table>
|
||||
</div>
|
||||
<a name="fusion.support.is_view.expression_semantics"></a><h4>
|
||||
<a name="id447470"></a>
|
||||
<a href="is_view.html#fusion.support.is_view.expression_semantics">Expression Semantics</a>
|
||||
</h4>
|
||||
<pre class="programlisting">
|
||||
<span class="keyword">typedef</span> <span class="identifier">traits</span><span class="special">::</span><span class="identifier">is_view</span><span class="special"><</span><span class="identifier">T</span><span class="special">>::</span><span class="identifier">type</span> <span class="identifier">c</span><span class="special">;</span>
|
||||
</pre>
|
||||
<p>
|
||||
<span class="bold"><b>Return type</b></span>: An MPL Boolean Constant.
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><b>Semantics</b></span>: Metafunction that evaluates to
|
||||
<tt class="computeroutput"><span class="identifier">mpl</span><span class="special">::</span><span class="identifier">true_</span></tt> if a certain type <tt class="computeroutput"><span class="identifier">T</span></tt>
|
||||
is a conforming Fusion view, <tt class="computeroutput"><span class="identifier">mpl</span><span class="special">::</span><span class="identifier">false_</span></tt>
|
||||
otherwise.
|
||||
</p>
|
||||
<a name="fusion.support.is_view.header"></a><h4>
|
||||
<a name="id447622"></a>
|
||||
<a href="is_view.html#fusion.support.is_view.header">Header</a>
|
||||
</h4>
|
||||
<pre class="programlisting">
|
||||
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">fusion</span><span class="special">/</span><span class="identifier">support</span><span class="special">/</span><span class="identifier">is_view</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
|
||||
</pre>
|
||||
<a name="fusion.support.is_view.example"></a><h4>
|
||||
<a name="id447710"></a>
|
||||
<a href="is_view.html#fusion.support.is_view.example">Example</a>
|
||||
</h4>
|
||||
<pre class="programlisting">
|
||||
<span class="identifier">BOOST_MPL_ASSERT_NOT</span><span class="special">((</span> <span class="identifier">traits</span><span class="special">::</span><span class="identifier">is_view</span><span class="special"><</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special"><</span><span class="keyword">int</span><span class="special">></span> <span class="special">></span> <span class="special">));</span>
|
||||
<span class="identifier">BOOST_MPL_ASSERT_NOT</span><span class="special">((</span> <span class="identifier">traits</span><span class="special">::</span><span class="identifier">is_view</span><span class="special"><</span><span class="keyword">int</span><span class="special">></span> <span class="special">));</span>
|
||||
|
||||
<span class="keyword">using</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">mpl</span><span class="special">::</span><span class="identifier">_</span>
|
||||
<span class="keyword">using</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">is_pointer</span><span class="special">;</span>
|
||||
<span class="keyword">typedef</span> <a href="../sequences/containers/vector.html" title="vector"><tt class="computeroutput"><span class="identifier">vector</span></tt></a><span class="special"><</span><span class="keyword">int</span><span class="special">*,</span> <span class="keyword">char</span><span class="special">,</span> <span class="keyword">long</span><span class="special">*,</span> <span class="keyword">bool</span><span class="special">,</span> <span class="keyword">double</span><span class="special">></span> <span class="identifier">vector_type</span><span class="special">;</span>
|
||||
<span class="keyword">typedef</span> <a href="../sequences/views/filter_view.html" title="filter_view"><tt class="computeroutput"><span class="identifier">filter_view</span></tt></a><span class="special"><</span><span class="identifier">vector_type</span><span class="special">,</span> <span class="identifier">is_pointer</span><span class="special"><</span><span class="identifier">_</span><span class="special">></span> <span class="special">></span> <span class="identifier">filter_view_type</span><span class="special">;</span>
|
||||
<span class="identifier">BOOST_MPL_ASSERT</span><span class="special">((</span> <span class="identifier">traits</span><span class="special">::</span><span class="identifier">is_view</span><span class="special"><</span><span class="identifier">filter_view_type</span><span class="special">></span> <span class="special">));</span>
|
||||
</pre>
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><small>Copyright <20> 2001-2005 Joel de Guzman, Dan Marsden</small></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="is_sequence.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../support.html"><img src="../../images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../images/home.png" alt="Home"></a><a accesskey="n" href="tag_of.html"><img src="../../images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
212
doc/html/fusion/support/pair.html
Normal file
212
doc/html/fusion/support/pair.html
Normal file
@ -0,0 +1,212 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<title>pair</title>
|
||||
<link rel="stylesheet" href="../../boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.66.1">
|
||||
<link rel="start" href="../../index.html" title="Chapter<65>1.<2E>Fusion 2.0">
|
||||
<link rel="up" href="../support.html" title="Support">
|
||||
<link rel="prev" href="category_of.html" title="category_of">
|
||||
<link rel="next" href="../iterators.html" title="Iterators">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
<table cellpadding="2" width="100%">
|
||||
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
|
||||
<td align="center"><a href="../../../../../../index.htm">Home</a></td>
|
||||
<td align="center"><a href="../../../../../libraries.htm">Libraries</a></td>
|
||||
<td align="center"><a href="../../../../../../people/people.htm">People</a></td>
|
||||
<td align="center"><a href="../../../../../../more/faq.htm">FAQ</a></td>
|
||||
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
|
||||
</table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="category_of.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../support.html"><img src="../../images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../images/home.png" alt="Home"></a><a accesskey="n" href="../iterators.html"><img src="../../images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
<div class="section" lang="en">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
<a name="fusion.support.pair"></a><a href="pair.html" title="pair">pair</a></h3></div></div></div>
|
||||
<a name="fusion.support.pair.description"></a><h4>
|
||||
<a name="id450224"></a>
|
||||
<a href="pair.html#fusion.support.pair.description">Description</a>
|
||||
</h4>
|
||||
<p>
|
||||
Fusion <tt class="computeroutput"><span class="identifier">pair</span></tt> type is a half
|
||||
runtime pair. A half runtime pair is similar to a <a href="../sequences/adapted/std__pair.html" title="std::pair"><tt class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span></tt></a>,
|
||||
but, unlike <a href="../sequences/adapted/std__pair.html" title="std::pair"><tt class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span></tt></a>,
|
||||
the first type does not have data. It is used as elements in <span class="underline">_map</span>_s,
|
||||
for example.
|
||||
</p>
|
||||
<a name="fusion.support.pair.synopsis"></a><h4>
|
||||
<a name="id450325"></a>
|
||||
<a href="pair.html#fusion.support.pair.synopsis">Synopsis</a>
|
||||
</h4>
|
||||
<pre class="programlisting">
|
||||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">First</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Second</span><span class="special">></span>
|
||||
<span class="keyword">struct</span> <span class="identifier">pair</span><span class="special">;</span>
|
||||
</pre>
|
||||
<a name="fusion.support.pair.template_parameters"></a><h4>
|
||||
<a name="id450419"></a>
|
||||
<a href="pair.html#fusion.support.pair.template_parameters">Template parameters</a>
|
||||
</h4>
|
||||
<div class="informaltable">
|
||||
<h4>
|
||||
<a name="id450440"></a>
|
||||
</h4>
|
||||
<table class="table">
|
||||
<colgroup>
|
||||
<col>
|
||||
<col>
|
||||
</colgroup>
|
||||
<thead><tr>
|
||||
<th>Parameter</th>
|
||||
<th>Description</th>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>First</td>
|
||||
<td>The first type. This is purely a type. No
|
||||
data is held.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Second</td>
|
||||
<td>The second type. This contains data.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="variablelist">
|
||||
<p class="title"><b>Notation</b></p>
|
||||
<dl>
|
||||
<dt><span class="term"><tt class="computeroutput"><span class="identifier">P</span></tt></span></dt>
|
||||
<dd>
|
||||
Fusion pair type
|
||||
</dd>
|
||||
<dt><span class="term"><tt class="computeroutput"><span class="identifier">p</span></tt>,
|
||||
<tt class="computeroutput"><span class="identifier">p2</span></tt></span></dt>
|
||||
<dd>
|
||||
Fusion pairs
|
||||
</dd>
|
||||
<dt><span class="term"><tt class="computeroutput"><span class="identifier">F</span></tt>,
|
||||
<tt class="computeroutput"><span class="identifier">S</span></tt></span></dt>
|
||||
<dd>
|
||||
Arbitrary types
|
||||
</dd>
|
||||
<dt><span class="term"><tt class="computeroutput"><span class="identifier">s</span></tt></span></dt>
|
||||
<dd>
|
||||
Value of type <tt class="computeroutput"><span class="identifier">S</span></tt>
|
||||
</dd>
|
||||
<dt><span class="term"><tt class="computeroutput"><span class="identifier">o</span></tt></span></dt>
|
||||
<dd>
|
||||
Output stream
|
||||
</dd>
|
||||
<dt><span class="term"><tt class="computeroutput"><span class="identifier">i</span></tt></span></dt>
|
||||
<dd>
|
||||
Input stream
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<a name="fusion.support.pair.expression_semantics"></a><h4>
|
||||
<a name="id450644"></a>
|
||||
<a href="pair.html#fusion.support.pair.expression_semantics">Expression Semantics</a>
|
||||
</h4>
|
||||
<div class="informaltable">
|
||||
<h4>
|
||||
<a name="id450665"></a>
|
||||
</h4>
|
||||
<table class="table">
|
||||
<colgroup>
|
||||
<col>
|
||||
<col>
|
||||
</colgroup>
|
||||
<thead><tr>
|
||||
<th>Expression</th>
|
||||
<th>Semantics</th>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><tt class="computeroutput"><span class="identifier">P</span><span class="special">::</span><span class="identifier">first_type</span></tt></td>
|
||||
<td>The type
|
||||
of the first template parameter, <tt class="computeroutput"><span class="identifier">F</span></tt>.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt class="computeroutput"><span class="identifier">P</span><span class="special">::</span><span class="identifier">second_type</span></tt></td>
|
||||
<td>The type
|
||||
of the second template parameter, <tt class="computeroutput"><span class="identifier">S</span></tt>.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt class="computeroutput"><span class="identifier">P</span><span class="special">()</span></tt></td>
|
||||
<td>Default
|
||||
construction.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt class="computeroutput"><span class="identifier">P</span><span class="special">(</span><span class="identifier">s</span><span class="special">)</span></tt></td>
|
||||
<td>Construct
|
||||
a pair given value for the second type, <tt class="computeroutput"><span class="identifier">s</span></tt>.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt class="computeroutput"><span class="identifier">P</span><span class="special">(</span><span class="identifier">p2</span><span class="special">)</span></tt></td>
|
||||
<td>Copy
|
||||
constructs a pair from another pair, <tt class="computeroutput"><span class="identifier">p2</span></tt>.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt class="computeroutput"><span class="identifier">p</span><EFBFBD><span class="special">=</span><EFBFBD><span class="identifier">p2</span></tt></td>
|
||||
<td>Assigns a pair,
|
||||
p1, from another pair, <tt class="computeroutput"><span class="identifier">p2</span></tt>.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>make_pair<F>(s)</td>
|
||||
<td>Make a pair given the first
|
||||
type, <tt class="computeroutput"><span class="identifier">F</span></tt>, and a value
|
||||
for the second type, <tt class="computeroutput"><span class="identifier">s</span></tt>.
|
||||
The second type assumes the type of <tt class="computeroutput"><span class="identifier">s</span></tt>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt class="computeroutput"><span class="identifier">o</span><EFBFBD><span class="special"><<</span><EFBFBD><span class="identifier">p</span></tt></td>
|
||||
<td>Output <tt class="computeroutput"><span class="identifier">p</span></tt> to output stream, <tt class="computeroutput"><span class="identifier">o</span></tt>.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt class="computeroutput"><span class="identifier">i</span><EFBFBD><span class="special">>></span><EFBFBD><span class="identifier">p</span></tt></td>
|
||||
<td>Input <tt class="computeroutput"><span class="identifier">p</span></tt> from input stream, <tt class="computeroutput"><span class="identifier">i</span></tt>.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt class="computeroutput"><span class="identifier">p</span><EFBFBD><span class="special">==</span><EFBFBD><span class="identifier">p2</span></tt></td>
|
||||
<td>Tests two pairs
|
||||
for equality.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><tt class="computeroutput"><span class="identifier">p</span><EFBFBD><span class="special">!=</span><EFBFBD><span class="identifier">p2</span></tt></td>
|
||||
<td>Tests two pairs
|
||||
for inequality.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<a name="fusion.support.pair.header"></a><h4>
|
||||
<a name="id451130"></a>
|
||||
<a href="pair.html#fusion.support.pair.header">Header</a>
|
||||
</h4>
|
||||
<pre class="programlisting">
|
||||
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">fusion</span><span class="special">/</span><span class="identifier">support</span><span class="special">/</span><span class="identifier">pair</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
|
||||
</pre>
|
||||
<a name="fusion.support.pair.example"></a><h4>
|
||||
<a name="id451222"></a>
|
||||
<a href="pair.html#fusion.support.pair.example">Example</a>
|
||||
</h4>
|
||||
<pre class="programlisting">
|
||||
<span class="identifier">pair</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">char</span><span class="special">></span> <span class="identifier">p</span><span class="special">(</span><span class="char">'X'</span><span class="special">);</span>
|
||||
<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">p</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
|
||||
<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">make_pair</span><span class="special"><</span><span class="keyword">int</span><span class="special">>(</span><span class="char">'X'</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
|
||||
<span class="identifier">assert</span><span class="special">((</span><span class="identifier">p</span> <span class="special">==</span> <span class="identifier">make_pair</span><span class="special"><</span><span class="keyword">int</span><span class="special">>(</span><span class="char">'X'</span><span class="special">)));</span>
|
||||
</pre>
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><small>Copyright <20> 2001-2005 Joel de Guzman, Dan Marsden</small></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="category_of.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../support.html"><img src="../../images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../images/home.png" alt="Home"></a><a accesskey="n" href="../iterators.html"><img src="../../images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
130
doc/html/fusion/support/tag_of.html
Normal file
130
doc/html/fusion/support/tag_of.html
Normal file
@ -0,0 +1,130 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<title>tag_of</title>
|
||||
<link rel="stylesheet" href="../../boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.66.1">
|
||||
<link rel="start" href="../../index.html" title="Chapter<65>1.<2E>Fusion 2.0">
|
||||
<link rel="up" href="../support.html" title="Support">
|
||||
<link rel="prev" href="is_view.html" title="is_view">
|
||||
<link rel="next" href="category_of.html" title="category_of">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
<table cellpadding="2" width="100%">
|
||||
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
|
||||
<td align="center"><a href="../../../../../../index.htm">Home</a></td>
|
||||
<td align="center"><a href="../../../../../libraries.htm">Libraries</a></td>
|
||||
<td align="center"><a href="../../../../../../people/people.htm">People</a></td>
|
||||
<td align="center"><a href="../../../../../../more/faq.htm">FAQ</a></td>
|
||||
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
|
||||
</table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="is_view.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../support.html"><img src="../../images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../images/home.png" alt="Home"></a><a accesskey="n" href="category_of.html"><img src="../../images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
<div class="section" lang="en">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
<a name="fusion.support.tag_of"></a><a href="tag_of.html" title="tag_of">tag_of</a></h3></div></div></div>
|
||||
<a name="fusion.support.tag_of.description"></a><h4>
|
||||
<a name="id448159"></a>
|
||||
<a href="tag_of.html#fusion.support.tag_of.description">Description</a>
|
||||
</h4>
|
||||
<p>
|
||||
All conforming Fusion sequences and iterators have an associated tag type.
|
||||
The purpose of the tag is to enable <a href="../notes.html#fusion.notes.tag_dispatching"><span class="emphasis"><em>tag
|
||||
dispatching</em></span></a> from <a href="../sequences/intrinsics.html" title="Intrinsics">Intrinsic</a>
|
||||
functions to implementations appropriate for the type. The default implementation
|
||||
of <tt class="computeroutput"><span class="identifier">tag_of</span></tt> returns <tt class="computeroutput"><span class="identifier">T</span><span class="special">::</span><span class="identifier">ftag</span></tt>
|
||||
for a given type <tt class="computeroutput"><span class="identifier">T</span></tt>, if such
|
||||
a member typedef exists.
|
||||
</p>
|
||||
<p>
|
||||
This metafunction may be specialized to accomodate clients providing Fusion
|
||||
conforming sequences.
|
||||
</p>
|
||||
<a name="fusion.support.tag_of.synopsis"></a><h4>
|
||||
<a name="id448253"></a>
|
||||
<a href="tag_of.html#fusion.support.tag_of.synopsis">Synopsis</a>
|
||||
</h4>
|
||||
<pre class="programlisting">
|
||||
<span class="keyword">namespace</span> <span class="identifier">traits</span>
|
||||
<span class="special">{</span>
|
||||
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">Sequence</span><span class="special">></span>
|
||||
<span class="keyword">struct</span> <span class="identifier">tag_of</span>
|
||||
<span class="special">{</span>
|
||||
<span class="keyword">typedef</span> <span class="emphasis"><em>unspecified</em></span> <span class="identifier">type</span><span class="special">;</span>
|
||||
<span class="special">};</span>
|
||||
<span class="special">}</span>
|
||||
</pre>
|
||||
<p>
|
||||
namespace traits { template<typename Sequence> struct tag_of { typedef
|
||||
<span class="emphasis"><em>unspecified</em></span> type; }; } [heading Parameters]
|
||||
</p>
|
||||
<div class="informaltable">
|
||||
<h4>
|
||||
<a name="id448388"></a>
|
||||
</h4>
|
||||
<table class="table">
|
||||
<colgroup>
|
||||
<col>
|
||||
<col>
|
||||
<col>
|
||||
</colgroup>
|
||||
<thead><tr>
|
||||
<th>Parameter</th>
|
||||
<th>Requirement</th>
|
||||
<th>Description</th>
|
||||
</tr></thead>
|
||||
<tbody><tr>
|
||||
<td><tt class="computeroutput"><span class="identifier">T</span></tt></td>
|
||||
<td>Any
|
||||
type</td>
|
||||
<td>The type to query.</td>
|
||||
</tr></tbody>
|
||||
</table>
|
||||
</div>
|
||||
<a name="fusion.support.tag_of.expression_semantics"></a><h4>
|
||||
<a name="id448452"></a>
|
||||
<a href="tag_of.html#fusion.support.tag_of.expression_semantics">Expression Semantics</a>
|
||||
</h4>
|
||||
<pre class="programlisting">
|
||||
<span class="keyword">typedef</span> <span class="identifier">traits</span><span class="special">::</span><span class="identifier">tag_of</span><span class="special"><</span><span class="identifier">T</span><span class="special">>::</span><span class="identifier">type</span> <span class="identifier">tag</span><span class="special">;</span>
|
||||
</pre>
|
||||
<p>
|
||||
<span class="bold"><b>Return type</b></span>: Any type.
|
||||
</p>
|
||||
<p>
|
||||
<span class="bold"><b>Semantics</b></span>: Returns the tag type associated
|
||||
with <tt class="computeroutput"><span class="identifier">T</span></tt>.
|
||||
</p>
|
||||
<a name="fusion.support.tag_of.header"></a><h4>
|
||||
<a name="id448565"></a>
|
||||
<a href="tag_of.html#fusion.support.tag_of.header">Header</a>
|
||||
</h4>
|
||||
<pre class="programlisting">
|
||||
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">fusion</span><span class="special">/</span><span class="identifier">support</span><span class="special">/</span><span class="identifier">tag_of</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
|
||||
</pre>
|
||||
<a name="fusion.support.tag_of.example"></a><h4>
|
||||
<a name="id448653"></a>
|
||||
<a href="tag_of.html#fusion.support.tag_of.example">Example</a>
|
||||
</h4>
|
||||
<pre class="programlisting">
|
||||
<span class="keyword">typedef</span> <span class="identifier">traits</span><span class="special">::</span><span class="identifier">is_sequence</span><span class="special"><</span><a href="../sequences/containers/list.html" title="list"><tt class="computeroutput"><span class="identifier">list</span></tt></a><span class="special"><></span> <span class="identifier">tag1</span><span class="special">;</span>
|
||||
<span class="keyword">typedef</span> <span class="identifier">traits</span><span class="special">::</span><span class="identifier">is_sequence</span><span class="special"><</span><a href="../sequences/containers/list.html" title="list"><tt class="computeroutput"><span class="identifier">list</span></tt></a><span class="special"><</span><span class="keyword">int</span><span class="special">></span> <span class="special">></span> <span class="identifier">tag2</span><span class="special">;</span>
|
||||
<span class="keyword">typedef</span> <span class="identifier">traits</span><span class="special">::</span><span class="identifier">is_sequence</span><span class="special"><</span><a href="../sequences/containers/vector.html" title="vector"><tt class="computeroutput"><span class="identifier">vector</span></tt></a><span class="special"><></span> <span class="special">></span> <span class="identifier">tag3</span><span class="special">;</span>
|
||||
<span class="keyword">typedef</span> <span class="identifier">traits</span><span class="special">::</span><span class="identifier">is_sequence</span><span class="special"><</span><a href="../sequences/containers/vector.html" title="vector"><tt class="computeroutput"><span class="identifier">vector</span></tt></a><span class="special"><</span><span class="keyword">int</span><span class="special">></span> <span class="special">></span> <span class="identifier">tag4</span><span class="special">;</span>
|
||||
|
||||
<span class="identifier">BOOST_MPL_ASSERT</span><span class="special">((</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">is_same</span><span class="special"><</span><span class="identifier">tag1</span><span class="special">,</span> <span class="identifier">tag2</span><span class="special">>));</span>
|
||||
<span class="identifier">BOOST_MPL_ASSERT</span><span class="special">((</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">is_same</span><span class="special"><</span><span class="identifier">tag3</span><span class="special">,</span> <span class="identifier">tag4</span><span class="special">>));</span>
|
||||
</pre>
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
<td align="right"><small>Copyright <20> 2001-2005 Joel de Guzman, Dan Marsden</small></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="is_view.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../support.html"><img src="../../images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../images/home.png" alt="Home"></a><a accesskey="n" href="category_of.html"><img src="../../images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user