Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/libs/mpl/doc/refmanual/bool.html @ 29

Last change on this file since 29 was 29, checked in by landauf, 17 years ago

updated boost from 1_33_1 to 1_34_1

File size: 7.5 KB
Line 
1<?xml version="1.0" encoding="utf-8" ?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4<!-- Copyright Aleksey Gurtovoy 2006. Distributed under the Boost -->
5<!-- Software License, Version 1.0. (See accompanying -->
6<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
7<head>
8<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
9<meta name="generator" content="Docutils 0.3.6: http://docutils.sourceforge.net/" />
10<title>The MPL Reference Manual: bool_</title>
11<link rel="stylesheet" href="../style.css" type="text/css" />
12</head>
13<body class="docframe refmanual">
14<table class="header"><tr class="header"><td class="header-group navigation-bar"><span class="navigation-group"><a href="./numeric.html" class="navigation-link">Prev</a>&nbsp;<a href="./int.html" class="navigation-link">Next</a></span><span class="navigation-group-separator">&nbsp;|&nbsp;</span><span class="navigation-group">Back&nbsp;<a href="./int.html" class="navigation-link">Along</a></span><span class="navigation-group-separator">&nbsp;|&nbsp;</span><span class="navigation-group"><a href="./numeric.html" class="navigation-link">Up</a>&nbsp;<a href="../refmanual.html" class="navigation-link">Home</a></span><span class="navigation-group-separator">&nbsp;|&nbsp;</span><span class="navigation-group"><a href="./refmanual_toc.html" class="navigation-link">Full TOC</a></span></td>
15<td class="header-group page-location"><a href="../refmanual.html" class="navigation-link">Front Page</a> / <a href="./data-types.html" class="navigation-link">Data Types</a> / <a href="./numeric.html" class="navigation-link">Numeric</a> / <a href="./bool.html" class="navigation-link">bool_</a></td>
16</tr></table><div class="header-separator"></div>
17<div class="section" id="bool">
18<h1><a class="toc-backref" href="./numeric.html#id500" name="bool">bool_</a></h1>
19<div class="section" id="bool-synopsis">
20<h3><a class="subsection-title" href="#synopsis" name="synopsis">Synopsis</a></h3>
21<pre class="literal-block">
22template&lt;
23      bool C
24    &gt;
25struct <a href="./bool.html" class="identifier">bool_</a>
26{
27    // <em>unspecified</em>
28    // ...
29};
30
31typedef <a href="./bool.html" class="identifier">bool_</a>&lt;true&gt;  true_;
32typedef <a href="./bool.html" class="identifier">bool_</a>&lt;false&gt; false_;
33</pre>
34</div>
35<div class="section" id="bool-description">
36<h3><a class="subsection-title" href="#description" name="description">Description</a></h3>
37<p>A boolean <a class="reference" href="./integral-constant.html">Integral Constant</a> wrapper.</p>
38</div>
39<div class="section" id="bool-header">
40<h3><a class="subsection-title" href="#header" name="header">Header</a></h3>
41<pre class="literal-block">
42#include &lt;<a href="../../../../boost/mpl/bool.hpp" class="header">boost/mpl/bool.hpp</a>&gt;
43</pre>
44</div>
45<div class="section" id="bool-model-of">
46<h3><a class="subsection-title" href="#model-of" name="model-of">Model of</a></h3>
47<p><a class="reference" href="./integral-constant.html">Integral Constant</a></p>
48</div>
49<div class="section" id="bool-parameters">
50<h3><a class="subsection-title" href="#parameters" name="parameters">Parameters</a></h3>
51<table border="1" class="table">
52<colgroup>
53<col width="21%" />
54<col width="42%" />
55<col width="37%" />
56</colgroup>
57<thead valign="bottom">
58<tr><th>Parameter</th>
59<th>Requirement</th>
60<th>Description</th>
61</tr>
62</thead>
63<tbody valign="top">
64<tr><td><tt class="literal"><span class="pre">C</span></tt></td>
65<td>A boolean integral constant</td>
66<td>A value to wrap.</td>
67</tr>
68</tbody>
69</table>
70</div>
71<div class="section" id="bool-expression-semantics">
72<h3><a class="subsection-title" href="#expression-semantics" name="expression-semantics">Expression semantics</a></h3>
73<p>The semantics of an expression are defined only
74where they differ from, or are not defined in <a class="reference" href="./integral-constant.html">Integral Constant</a>.</p>
75<p>For arbitrary integral constant <tt class="literal"><span class="pre">c</span></tt>:</p>
76<table border="1" class="table">
77<colgroup>
78<col width="24%" />
79<col width="76%" />
80</colgroup>
81<thead valign="bottom">
82<tr><th>Expression</th>
83<th>Semantics</th>
84</tr>
85</thead>
86<tbody valign="top">
87<tr><td><tt class="literal"><span class="pre"><a href="./bool.html" class="identifier">bool_</a>&lt;c&gt;</span></tt></td>
88<td>An <a class="reference" href="./integral-constant.html">Integral Constant</a> <tt class="literal"><span class="pre">x</span></tt> such that <tt class="literal"><span class="pre">x::value</span> <span class="pre">==</span> <span class="pre">c</span></tt>
89and <tt class="literal"><span class="pre">x::<a href="./value-type.html" class="identifier">value_type</a></span></tt> is identical to <tt class="literal"><span class="pre">bool</span></tt>.</td>
90</tr>
91</tbody>
92</table>
93</div>
94<div class="section" id="bool-example">
95<h3><a class="subsection-title" href="#example" name="example">Example</a></h3>
96<pre class="literal-block">
97<a href="./assert.html" class="identifier">BOOST_MPL_ASSERT</a>(( is_same&lt; <a href="./bool.html" class="identifier">bool_</a>&lt;true&gt;::<a href="./value-type.html" class="identifier">value_type</a>, bool &gt; ));
98<a href="./assert.html" class="identifier">BOOST_MPL_ASSERT</a>(( is_same&lt; <a href="./bool.html" class="identifier">bool_</a>&lt;true&gt;, <a class="reference" href="./bool.html"><tt class="literal"><span class="pre">true_</span></tt></a> &gt; )); }
99<a href="./assert.html" class="identifier">BOOST_MPL_ASSERT</a>(( is_same&lt; <a href="./bool.html" class="identifier">bool_</a>&lt;true&gt;::type, <a href="./bool.html" class="identifier">bool_</a>&lt;true&gt; &gt; ));
100<a href="./assert-relation.html" class="identifier">BOOST_MPL_ASSERT_RELATION</a>( <a href="./bool.html" class="identifier">bool_</a>&lt;true&gt;::value, ==, true );
101assert( <a href="./bool.html" class="identifier">bool_</a>&lt;true&gt;() == true );
102</pre>
103</div>
104<div class="section" id="bool-see-also">
105<h3><a class="subsection-title" href="#see-also" name="see-also">See also</a></h3>
106<p><a class="reference" href="./data-types.html">Data Types</a>, <a class="reference" href="./integral-constant.html">Integral Constant</a>, <a class="refentry reference" href="./int.html"><tt class="refentry literal"><span class="pre">int_</span></tt></a>, <a class="refentry reference" href="./long.html"><tt class="refentry literal"><span class="pre">long_</span></tt></a>, <a class="refentry reference" href="./integral-c.html"><tt class="refentry literal"><span class="pre">integral_c</span></tt></a></p>
107<!-- modtime: November 10, 2004 04:44:19 +0000 -->
108<!-- Data Types/Numeric//int_ |20 -->
109</div>
110</div>
111
112<div class="footer-separator"></div>
113<table class="footer"><tr class="footer"><td class="header-group navigation-bar"><span class="navigation-group"><a href="./numeric.html" class="navigation-link">Prev</a>&nbsp;<a href="./int.html" class="navigation-link">Next</a></span><span class="navigation-group-separator">&nbsp;|&nbsp;</span><span class="navigation-group">Back&nbsp;<a href="./int.html" class="navigation-link">Along</a></span><span class="navigation-group-separator">&nbsp;|&nbsp;</span><span class="navigation-group"><a href="./numeric.html" class="navigation-link">Up</a>&nbsp;<a href="../refmanual.html" class="navigation-link">Home</a></span><span class="navigation-group-separator">&nbsp;|&nbsp;</span><span class="navigation-group"><a href="./refmanual_toc.html" class="navigation-link">Full TOC</a></span></td>
114</tr></table></body>
115</html>
Note: See TracBrowser for help on using the repository browser.