Files
boost_fusion/doc/html/fusion/support/is_sequence.html
Joel de Guzman d004046aa5 Merge from Trunk
[SVN r49252]
2008-10-10 15:05:47 +00:00

152 lines
10 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>is_sequence</title>
<link rel="stylesheet" href="../../../../../../doc/html/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.66.1">
<link rel="start" href="../../index.html" title="Chapter 1. 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%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../support.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../support.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="is_view.html"><img src="../../../../../../doc/html/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="id459766"></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="../sequence.html" title="Sequence">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="id459859"></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">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</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="id459990"></a>
<a href="is_sequence.html#fusion.support.is_sequence.parameters">Parameters</a>
</h4>
<div class="informaltable"><table class="table">
<colgroup>
<col>
<col>
<col>
</colgroup>
<thead><tr>
<th>
<p>
Parameter
</p>
</th>
<th>
<p>
Requirement
</p>
</th>
<th>
<p>
Description
</p>
</th>
</tr></thead>
<tbody><tr>
<td>
<p>
<tt class="computeroutput"><span class="identifier">T</span></tt>
</p>
</td>
<td>
<p>
Any type
</p>
</td>
<td>
<p>
The type to query.
</p>
</td>
</tr></tbody>
</table></div>
<a name="fusion.support.is_sequence.expression_semantics"></a><h4>
<a name="id460096"></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">&lt;</span><span class="identifier">T</span><span class="special">&gt;::</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 <a href="http://www.boost.org/libs/mpl/doc/refmanual/integral-constant.html" target="_top">MPL
Boolean Constant</a>.
</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="id460267"></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">&lt;</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">&gt;</span>
<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">fusion</span><span class="special">/</span><span class="identifier">include</span><span class="special">/</span><span class="identifier">is_sequence</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
</pre>
<a name="fusion.support.is_sequence.example"></a><h4>
<a name="id460424"></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">&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</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="identifier">BOOST_MPL_ASSERT_NOT</span><span class="special">((</span> <span class="identifier">is_sequence</span><span class="special">&lt;</span> <span class="keyword">int</span> <span class="special">&gt;</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">&lt;</span><a href="../container/list.html" title="list"><tt class="computeroutput"><span class="identifier">list</span></tt></a><span class="special">&lt;&gt;</span> <span class="special">&gt;</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">&lt;</span><a href="../container/list.html" title="list"><tt class="computeroutput"><span class="identifier">list</span></tt></a><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="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">&lt;</span><a href="../container/vector.html" title="vector"><tt class="computeroutput"><span class="identifier">vector</span></tt></a><span class="special">&lt;&gt;</span> <span class="special">&gt;</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">&lt;</span><a href="../container/vector.html" title="vector"><tt class="computeroutput"><span class="identifier">vector</span></tt></a><span class="special">&lt;</span><span class="keyword">int</span><span class="special">&gt;</span> <span class="special">&gt;</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"><div class="copyright-footer">Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias
Schwinger<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../support.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../support.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="is_view.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
</div>
</body>
</html>