bool.html 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6. <meta name="generator" content="Docutils 0.7: http://docutils.sourceforge.net/" />
  7. <title>The MPL Reference Manual: bool_</title>
  8. <link rel="stylesheet" href="../style.css" type="text/css" />
  9. </head>
  10. <body class="docframe refmanual">
  11. <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>
  12. <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>
  13. </tr></table><div class="header-separator"></div>
  14. <div class="section" id="bool">
  15. <h1><a class="toc-backref" href="./numeric.html#id1576">bool_</a></h1>
  16. <div class="section" id="id1222">
  17. <h3><a class="subsection-title" href="#synopsis" name="synopsis">Synopsis</a></h3>
  18. <pre class="literal-block">
  19. template&lt;
  20. bool C
  21. &gt;
  22. struct <a href="./bool.html" class="identifier">bool_</a>
  23. {
  24. // <em>unspecified</em>
  25. // ...
  26. };
  27. typedef <a href="./bool.html" class="identifier">bool_</a>&lt;true&gt; <a href="./bool.html" class="identifier">true_</a>;
  28. typedef <a href="./bool.html" class="identifier">bool_</a>&lt;false&gt; <a href="./bool.html" class="identifier">false_</a>;
  29. </pre>
  30. </div>
  31. <div class="section" id="id1223">
  32. <h3><a class="subsection-title" href="#description" name="description">Description</a></h3>
  33. <p>A boolean <a class="reference internal" href="./integral-constant.html">Integral Constant</a> wrapper.</p>
  34. </div>
  35. <div class="section" id="id1224">
  36. <h3><a class="subsection-title" href="#header" name="header">Header</a></h3>
  37. <pre class="literal-block">
  38. #include &lt;<a href="../../../../boost/mpl/bool.hpp" class="header">boost/mpl/bool.hpp</a>&gt;
  39. </pre>
  40. </div>
  41. <div class="section" id="id1225">
  42. <h3><a class="subsection-title" href="#model-of" name="model-of">Model of</a></h3>
  43. <p><a class="reference internal" href="./integral-constant.html">Integral Constant</a></p>
  44. </div>
  45. <div class="section" id="id1226">
  46. <h3><a class="subsection-title" href="#parameters" name="parameters">Parameters</a></h3>
  47. <table border="1" class="docutils table">
  48. <colgroup>
  49. <col width="21%" />
  50. <col width="42%" />
  51. <col width="37%" />
  52. </colgroup>
  53. <thead valign="bottom">
  54. <tr><th class="head">Parameter</th>
  55. <th class="head">Requirement</th>
  56. <th class="head">Description</th>
  57. </tr>
  58. </thead>
  59. <tbody valign="top">
  60. <tr><td><tt class="literal"><span class="pre">C</span></tt></td>
  61. <td>A boolean integral constant</td>
  62. <td>A value to wrap.</td>
  63. </tr>
  64. </tbody>
  65. </table>
  66. </div>
  67. <div class="section" id="id1227">
  68. <h3><a class="subsection-title" href="#expression-semantics" name="expression-semantics">Expression semantics</a></h3>
  69. <p>The semantics of an expression are defined only
  70. where they differ from, or are not defined in <a class="reference internal" href="./integral-constant.html">Integral Constant</a>.</p>
  71. <p>For arbitrary integral constant <tt class="literal"><span class="pre">c</span></tt>:</p>
  72. <table border="1" class="docutils table">
  73. <colgroup>
  74. <col width="24%" />
  75. <col width="76%" />
  76. </colgroup>
  77. <thead valign="bottom">
  78. <tr><th class="head">Expression</th>
  79. <th class="head">Semantics</th>
  80. </tr>
  81. </thead>
  82. <tbody valign="top">
  83. <tr><td><tt class="literal"><span class="pre"><a href="./bool.html" class="identifier">bool_</a>&lt;c&gt;</span></tt></td>
  84. <td>An <a class="reference internal" 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>
  85. 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>
  86. </tr>
  87. </tbody>
  88. </table>
  89. </div>
  90. <div class="section" id="id1228">
  91. <h3><a class="subsection-title" href="#example" name="example">Example</a></h3>
  92. <pre class="literal-block">
  93. <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; ));
  94. <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="./bool.html" class="identifier">true_</a> &gt; )); }
  95. <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; ));
  96. <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 );
  97. assert( <a href="./bool.html" class="identifier">bool_</a>&lt;true&gt;() == true );
  98. </pre>
  99. </div>
  100. <div class="section" id="id1229">
  101. <h3><a class="subsection-title" href="#see-also" name="see-also">See also</a></h3>
  102. <p><a class="reference internal" href="./data-types.html">Data Types</a>, <a class="reference internal" href="./integral-constant.html">Integral Constant</a>, <a class="reference internal" href="./int.html">int_</a>, <a class="reference internal" href="./long.html">long_</a>, <a class="reference internal" href="./integral-c.html">integral_c</a></p>
  103. <!-- Data Types/Numeric//int_ |20 -->
  104. </div>
  105. </div>
  106. <div class="footer-separator"></div>
  107. <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>
  108. <td><div class="copyright-footer"><div class="copyright">Copyright © 2001-2009 Aleksey Gurtovoy and David Abrahams</div>
  109. Distributed under the Boost Software License, Version 1.0. (See accompanying
  110. file LICENSE_1_0.txt or copy at <a class="reference external" href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)</div></td></tr></table></body>
  111. </html>