| 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> <a href="./int.html" class="navigation-link">Next</a></span><span class="navigation-group-separator"> | </span><span class="navigation-group">Back <a href="./int.html" class="navigation-link">Along</a></span><span class="navigation-group-separator"> | </span><span class="navigation-group"><a href="./numeric.html" class="navigation-link">Up</a> <a href="../refmanual.html" class="navigation-link">Home</a></span><span class="navigation-group-separator"> | </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"> |
|---|
| 22 | template< |
|---|
| 23 | bool C |
|---|
| 24 | > |
|---|
| 25 | struct <a href="./bool.html" class="identifier">bool_</a> |
|---|
| 26 | { |
|---|
| 27 | // <em>unspecified</em> |
|---|
| 28 | // ... |
|---|
| 29 | }; |
|---|
| 30 | |
|---|
| 31 | typedef <a href="./bool.html" class="identifier">bool_</a><true> true_; |
|---|
| 32 | typedef <a href="./bool.html" class="identifier">bool_</a><false> 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 <<a href="../../../../boost/mpl/bool.hpp" class="header">boost/mpl/bool.hpp</a>> |
|---|
| 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 |
|---|
| 74 | where 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><c></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> |
|---|
| 89 | and <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< <a href="./bool.html" class="identifier">bool_</a><true>::<a href="./value-type.html" class="identifier">value_type</a>, bool > )); |
|---|
| 98 | <a href="./assert.html" class="identifier">BOOST_MPL_ASSERT</a>(( is_same< <a href="./bool.html" class="identifier">bool_</a><true>, <a class="reference" href="./bool.html"><tt class="literal"><span class="pre">true_</span></tt></a> > )); } |
|---|
| 99 | <a href="./assert.html" class="identifier">BOOST_MPL_ASSERT</a>(( is_same< <a href="./bool.html" class="identifier">bool_</a><true>::type, <a href="./bool.html" class="identifier">bool_</a><true> > )); |
|---|
| 100 | <a href="./assert-relation.html" class="identifier">BOOST_MPL_ASSERT_RELATION</a>( <a href="./bool.html" class="identifier">bool_</a><true>::value, ==, true ); |
|---|
| 101 | assert( <a href="./bool.html" class="identifier">bool_</a><true>() == 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> <a href="./int.html" class="navigation-link">Next</a></span><span class="navigation-group-separator"> | </span><span class="navigation-group">Back <a href="./int.html" class="navigation-link">Along</a></span><span class="navigation-group-separator"> | </span><span class="navigation-group"><a href="./numeric.html" class="navigation-link">Up</a> <a href="../refmanual.html" class="navigation-link">Home</a></span><span class="navigation-group-separator"> | </span><span class="navigation-group"><a href="./refmanual_toc.html" class="navigation-link">Full TOC</a></span></td> |
|---|
| 114 | </tr></table></body> |
|---|
| 115 | </html> |
|---|