|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r62920 - in sandbox/SOC/2010/bits_and_ints/libs/integer/doc: . html html/boost_integer
From: muriloufg_at_[hidden]
Date: 2010-06-13 14:24:36
Author: murilov
Date: 2010-06-13 14:24:32 EDT (Sun, 13 Jun 2010)
New Revision: 62920
URL: http://svn.boost.org/trac/boost/changeset/62920
Log:
Documentation updated.
Text files modified:
sandbox/SOC/2010/bits_and_ints/libs/integer/doc/html/boost_integer/bits_and_ints.html | 598 ++++++++++++++++++++-------------------
sandbox/SOC/2010/bits_and_ints/libs/integer/doc/html/boost_integer/history.html | 4
sandbox/SOC/2010/bits_and_ints/libs/integer/doc/html/index.html | 2
sandbox/SOC/2010/bits_and_ints/libs/integer/doc/integer.qbk | 303 --------------------
4 files changed, 315 insertions(+), 592 deletions(-)
Modified: sandbox/SOC/2010/bits_and_ints/libs/integer/doc/html/boost_integer/bits_and_ints.html
==============================================================================
--- sandbox/SOC/2010/bits_and_ints/libs/integer/doc/html/boost_integer/bits_and_ints.html (original)
+++ sandbox/SOC/2010/bits_and_ints/libs/integer/doc/html/boost_integer/bits_and_ints.html 2010-06-13 14:24:32 EDT (Sun, 13 Jun 2010)
@@ -27,25 +27,31 @@
<a name="boost_integer.bits_and_ints"></a><a class="link" href="bits_and_ints.html" title="Bits and Ints"> Bits and Ints</a>
</h2></div></div></div>
<div class="toc"><dl>
+<dt><span class="section">Overview</span></dt>
<dt><span class="section"> Sign Extending</span></dt>
<dt><span class="section"> Bit Reversal</span></dt>
<dt><span class="section"> Same Sign</span></dt>
<dt><span class="section"> Sign function</span></dt>
<dt><span class="section"> Binary Utilities</span></dt>
</dl></div>
+<div class="section" title="Overview">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_integer.bits_and_ints.overview"></a><a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.overview" title="Overview">Overview</a>
+</h3></div></div></div>
<p>
- The intent of this library is to extend Boost.Integer with fast integer algorithms
- and utilities. This library can be included via <boost/integer/bits_and_ints.hpp>.
- </p>
+ The intent of this library is to extend Boost.Integer with fast integer algorithms
+ and utilities. This library can be included via <boost/integer/bits_and_ints.hpp>.
+ </p>
+</div>
<div class="section" title="Sign Extending">
<div class="titlepage"><div><div><h3 class="title">
<a name="boost_integer.bits_and_ints.sign_extend"></a><a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.sign_extend" title="Sign Extending"> Sign Extending</a>
</h3></div></div></div>
<div class="toc"><dl>
-<dt><span class="section"><a href="bits_and_ints.html#boost_integer.bits_and_ints.sign_extend.run_time_version">Run-time
- version</a></span></dt>
-<dt><span class="section"><a href="bits_and_ints.html#boost_integer.bits_and_ints.sign_extend.compile_time_version">Compile-time
- version</a></span></dt>
+<dt><span class="section"><a href="bits_and_ints.html#boost_integer.bits_and_ints.sign_extend.non_member_function_template__sign_extend_">Non-Member
+ Function Template <code class="computeroutput"><span class="identifier">sign_extend</span></code></a></span></dt>
+<dt><span class="section"><a href="bits_and_ints.html#boost_integer.bits_and_ints.sign_extend.template_class__static_sign_extend___">Template
+ Class <code class="computeroutput"><span class="identifier">static_sign_extend</span><span class="special"><></span></code></a></span></dt>
<dt><span class="section">Examples</span></dt>
</dl></div>
<p>
@@ -57,24 +63,31 @@
number, then -3 is represented as 1101 in binary. If we have 8 bits, then
-3 is 11111101. The most-significant bit of the 4-bit representation is replicated
sinistrally to fill in the destination when we convert to a representation
- with more bits; this is sign extending.
+ with more bits; this is sign extending. More about sign extending on http://en.wikipedia.org/wiki/Sign_extension
</p>
-<div class="section" title="Run-time version">
+<div class="section" title="Non-Member Function Template sign_extend">
<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_integer.bits_and_ints.sign_extend.run_time_version"></a><a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.sign_extend.run_time_version" title="Run-time version">Run-time
- version</a>
+<a name="boost_integer.bits_and_ints.sign_extend.non_member_function_template__sign_extend_"></a><a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.sign_extend.non_member_function_template__sign_extend_" title="Non-Member Function Template sign_extend">Non-Member
+ Function Template <code class="computeroutput"><span class="identifier">sign_extend</span></code></a>
</h4></div></div></div>
<p>
The run-time version can be included via <boost/integer/sign_extend.hpp>.
</p>
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">Type</span><span class="special">></span>
-<span class="keyword">inline</span> <span class="keyword">typename</span> <span class="identifier">enable_if</span><span class="special"><</span><span class="identifier">is_integral</span><span class="special"><</span><span class="identifier">Type</span><span class="special">>,</span> <span class="identifier">Type</span><span class="special">>::</span><span class="identifier">type</span>
-<span class="identifier">sign_extend</span><span class="special">(</span><span class="identifier">Type</span> <span class="identifier">data</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">bits</span><span class="special">);</span>
+<span class="identifier">Type</span> <span class="identifier">sign_extend</span><span class="special">(</span><span class="identifier">Type</span> <span class="identifier">data</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">bits</span><span class="special">);</span>
</pre>
-<a name="boost_integer.bits_and_ints.sign_extend.run_time_version.parameters"></a><h5>
-<a name="id36188118"></a>
- <a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.sign_extend.run_time_version.parameters">Parameters</a>
- </h5>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+<span class="bold"><strong>Requires: </strong></span><code class="computeroutput"><span class="identifier">bits</span></code>
+ must be smaller than the size (in bits) of <code class="computeroutput"><span class="identifier">Type</span></code>.
+ </li>
+<li class="listitem">
+<span class="bold"><strong>Remarks: </strong></span><code class="computeroutput"><span class="identifier">Type</span></code>
+ must be an integral type. If this constraint is not met, this function
+ do not participate in overload resolution.
+ </li>
+<li class="listitem"><span class="bold"><strong>Parameters:</strong></span></li>
+</ul></div>
<div class="informaltable"><table class="table">
<colgroup>
<col>
@@ -119,38 +132,44 @@
</tr>
</tbody>
</table></div>
-<a name="boost_integer.bits_and_ints.sign_extend.run_time_version.return"></a><h5>
-<a name="id36188215"></a>
- <a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.sign_extend.run_time_version.return">Return</a>
- </h5>
-<p>
- <code class="computeroutput"><span class="identifier">data</span></code> sign-extended to
- <code class="computeroutput"><span class="keyword">sizeof</span><span class="special">(</span><span class="identifier">Type</span><span class="special">)</span></code>
- bytes. The return type is <code class="computeroutput"><span class="identifier">Type</span></code>.
- </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+<span class="bold"><strong>Returns: </strong></span><code class="computeroutput"><span class="identifier">data</span></code>
+ sign-extended to <code class="computeroutput"><span class="keyword">sizeof</span><span class="special">(</span><span class="identifier">Type</span><span class="special">)</span></code> bytes.
+ </li>
+<li class="listitem">
+<span class="bold"><strong>Throws:</strong></span> none.
+ </li>
+</ul></div>
</div>
-<div class="section" title="Compile-time version">
+<div class="section" title="Template Class static_sign_extend<>">
<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_integer.bits_and_ints.sign_extend.compile_time_version"></a><a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.sign_extend.compile_time_version" title="Compile-time version">Compile-time
- version</a>
+<a name="boost_integer.bits_and_ints.sign_extend.template_class__static_sign_extend___"></a><a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.sign_extend.template_class__static_sign_extend___" title="Template Class static_sign_extend<>">Template
+ Class <code class="computeroutput"><span class="identifier">static_sign_extend</span><span class="special"><></span></code></a>
</h4></div></div></div>
<p>
The compile-time version can be included via <boost/integer/static_sign_extend.hpp>.
The result will be in <code class="computeroutput"><span class="identifier">value</span></code>
member.
</p>
-<pre class="programlisting"><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">Type</span><span class="special">,</span> <span class="identifier">Type</span> <span class="identifier">data</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">Bits</span><span class="special">,</span>
- <span class="keyword">class</span> <span class="identifier">Enable</span> <span class="special">=</span> <span class="emphasis"><em>implementation-defined</em></span><span class="special">></span>
+<pre class="programlisting"><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">Type</span><span class="special">,</span> <span class="identifier">Type</span> <span class="identifier">data</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">Bits</span><span class="special">></span>
<span class="keyword">struct</span> <span class="identifier">static_sign_extend</span>
<span class="special">{</span>
<span class="keyword">static</span> <span class="keyword">const</span> <span class="identifier">Type</span> <span class="identifier">value</span> <span class="special">=</span> <span class="emphasis"><em>implementation-defined</em></span><span class="special">;</span>
<span class="special">};</span>
</pre>
-<a name="boost_integer.bits_and_ints.sign_extend.compile_time_version.template_parameters"></a><h5>
-<a name="id36188440"></a>
- <a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.sign_extend.compile_time_version.template_parameters">Template
- Parameters</a>
- </h5>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+<span class="bold"><strong>Requires: </strong></span><code class="computeroutput"><span class="identifier">Bits</span></code>
+ must be smaller than the size, in bits, of <code class="computeroutput"><span class="identifier">Type</span></code>.
+ </li>
+<li class="listitem">
+<span class="bold"><strong>Remarks: </strong></span><code class="computeroutput"><span class="identifier">Type</span></code>
+ must be an integral type. If this constraint is not met, this metafunction
+ do not participate in overload resolution.
+ </li>
+<li class="listitem"><span class="bold"><strong>Template Parameters:</strong></span></li>
+</ul></div>
<div class="informaltable"><table class="table">
<colgroup>
<col>
@@ -212,12 +231,9 @@
<div class="titlepage"><div><div><h4 class="title">
<a name="boost_integer.bits_and_ints.sign_extend.examples"></a><a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.sign_extend.examples" title="Examples">Examples</a>
</h4></div></div></div>
-<a name="boost_integer.bits_and_ints.sign_extend.examples.run_time_version"></a><h5>
-<a name="id36188573"></a>
- <a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.sign_extend.examples.run_time_version">Run-time
- version</a>
- </h5>
-<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">integer</span><span class="special">/</span><span class="identifier">sign_extend</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+<span class="bold"><strong>Run-time version</strong></span><pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">integer</span><span class="special">/</span><span class="identifier">sign_extend</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span>
@@ -230,12 +246,9 @@
<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">result</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="comment">// -1
</span><span class="special">}</span>
</pre>
-<a name="boost_integer.bits_and_ints.sign_extend.examples.compile_time_version"></a><h5>
-<a name="id36188811"></a>
- <a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.sign_extend.examples.compile_time_version">Compile-time
- version</a>
- </h5>
-<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">integer</span><span class="special">/</span><span class="identifier">static_sign_extend</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+</li>
+<li class="listitem">
+<span class="bold"><strong>Compile-time version</strong></span><pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">integer</span><span class="special">/</span><span class="identifier">static_sign_extend</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span>
@@ -246,6 +259,8 @@
<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">result</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="comment">// -1
</span><span class="special">}</span>
</pre>
+</li>
+</ul></div>
</div>
</div>
<div class="section" title="Bit Reversal">
@@ -253,32 +268,27 @@
<a name="boost_integer.bits_and_ints.bit_reversal"></a><a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.bit_reversal" title="Bit Reversal"> Bit Reversal</a>
</h3></div></div></div>
<div class="toc"><dl>
-<dt><span class="section"><a href="bits_and_ints.html#boost_integer.bits_and_ints.bit_reversal.run_time_version">Run-time
- version</a></span></dt>
-<dt><span class="section"><a href="bits_and_ints.html#boost_integer.bits_and_ints.bit_reversal.compile_time_version">Compile-time
- version</a></span></dt>
+<dt><span class="section"><a href="bits_and_ints.html#boost_integer.bits_and_ints.bit_reversal.non_member_function__bit_reversal_">Non-Member
+ Function <code class="computeroutput"><span class="identifier">bit_reversal</span></code></a></span></dt>
+<dt><span class="section"><a href="bits_and_ints.html#boost_integer.bits_and_ints.bit_reversal.template_class__static_bit_reversal___">Template
+ Class <code class="computeroutput"><span class="identifier">static_bit_reversal</span><span class="special"><></span></code></a></span></dt>
<dt><span class="section">Examples</span></dt>
</dl></div>
<p>
The bit reversal functions reverts the bits of integral types.
</p>
-<div class="section" title="Run-time version">
+<div class="section" title="Non-Member Function bit_reversal">
<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_integer.bits_and_ints.bit_reversal.run_time_version"></a><a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.bit_reversal.run_time_version" title="Run-time version">Run-time
- version</a>
+<a name="boost_integer.bits_and_ints.bit_reversal.non_member_function__bit_reversal_"></a><a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.bit_reversal.non_member_function__bit_reversal_" title="Non-Member Function bit_reversal">Non-Member
+ Function <code class="computeroutput"><span class="identifier">bit_reversal</span></code></a>
</h4></div></div></div>
<p>
The run-time version can be included via <boost/integer/bit_reversal.hpp>.
- For valid types T, the function <code class="computeroutput"><span class="identifier">bit_reversal</span></code>
- will be:
</p>
<pre class="programlisting"><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">inline</span> <span class="identifier">T</span> <span class="identifier">bit_reversal</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">data</span><span class="special">);</span>
</pre>
-<a name="boost_integer.bits_and_ints.bit_reversal.run_time_version.parameters"></a><h5>
-<a name="id36189142"></a>
- <a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.bit_reversal.run_time_version.parameters">Parameters</a>
- </h5>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><span class="bold"><strong>Parameters:</strong></span></li></ul></div>
<div class="informaltable"><table class="table">
<colgroup>
<col>
@@ -312,34 +322,34 @@
</td>
</tr></tbody>
</table></div>
-<a name="boost_integer.bits_and_ints.bit_reversal.run_time_version.return"></a><h5>
-<a name="id36189226"></a>
- <a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.bit_reversal.run_time_version.return">Return</a>
- </h5>
-<p>
- <code class="computeroutput"><span class="identifier">data</span></code> with its bits reversed.
- </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+<span class="bold"><strong>Remarks: </strong></span><code class="computeroutput"><span class="identifier">T</span></code>
+ must be an integral type. If this constraint is not met, this function
+ do not participate in overload resolution.
+ </li>
+<li class="listitem">
+<span class="bold"><strong>Returns: </strong></span><code class="computeroutput"><span class="identifier">data</span></code>
+ with its bits reversed.
+ </li>
+</ul></div>
</div>
-<div class="section" title="Compile-time version">
+<div class="section" title="Template Class static_bit_reversal<>">
<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_integer.bits_and_ints.bit_reversal.compile_time_version"></a><a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.bit_reversal.compile_time_version" title="Compile-time version">Compile-time
- version</a>
+<a name="boost_integer.bits_and_ints.bit_reversal.template_class__static_bit_reversal___"></a><a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.bit_reversal.template_class__static_bit_reversal___" title="Template Class static_bit_reversal<>">Template
+ Class <code class="computeroutput"><span class="identifier">static_bit_reversal</span><span class="special"><></span></code></a>
</h4></div></div></div>
<p>
The compile-time version can be included via <boost/integer/static_bit_reversal.hpp>.
The result will be in <code class="computeroutput"><span class="identifier">value</span></code>
member.
</p>
-<pre class="programlisting"><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="identifier">T</span> <span class="identifier">data</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Enable</span> <span class="special">=</span> <span class="emphasis"><em>implementation-defined</em></span><span class="special">></span>
+<pre class="programlisting"><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="identifier">T</span> <span class="identifier">data</span><span class="special">></span>
<span class="keyword">struct</span> <span class="identifier">static_bit_reversal</span> <span class="special">{</span>
- <span class="keyword">static</span> <span class="keyword">const</span> <span class="identifier">Type</span> <span class="identifier">value</span> <span class="special">=</span> <span class="emphasis"><em>implementation-defined</em></span><span class="special">;</span>
+ <span class="keyword">static</span> <span class="keyword">const</span> <span class="identifier">T</span> <span class="identifier">value</span> <span class="special">=</span> <span class="emphasis"><em>implementation-defined</em></span><span class="special">;</span>
<span class="special">};</span>
</pre>
-<a name="boost_integer.bits_and_ints.bit_reversal.compile_time_version.template_parameters"></a><h5>
-<a name="id36189402"></a>
- <a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.bit_reversal.compile_time_version.template_parameters">Template
- Parameters</a>
- </h5>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><span class="bold"><strong>Template Parameters</strong></span></li></ul></div>
<div class="informaltable"><table class="table">
<colgroup>
<col>
@@ -385,16 +395,18 @@
</tbody>
</table></div>
</div>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">
+<span class="bold"><strong>Remarks: </strong></span><code class="computeroutput"><span class="identifier">T</span></code>
+ must be an integral type. If this constraint is not met, this metafunction
+ do not participate in overload resolution.
+ </li></ul></div>
<div class="section" title="Examples">
<div class="titlepage"><div><div><h4 class="title">
<a name="boost_integer.bits_and_ints.bit_reversal.examples"></a><a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.bit_reversal.examples" title="Examples">Examples</a>
</h4></div></div></div>
-<a name="boost_integer.bits_and_ints.bit_reversal.examples.run_time_version"></a><h5>
-<a name="id36189511"></a>
- <a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.bit_reversal.examples.run_time_version">Run-time
- version</a>
- </h5>
-<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">integer</span><span class="special">/</span><span class="identifier">bit_reversal</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+<span class="bold"><strong>Run-time version</strong></span><pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">integer</span><span class="special">/</span><span class="identifier">bit_reversal</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span>
@@ -408,12 +420,9 @@
</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">hex</span> <span class="special"><<</span> <span class="identifier">result</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="comment">// -1
</span><span class="special">}</span>
</pre>
-<a name="boost_integer.bits_and_ints.bit_reversal.examples.compile_time_version"></a><h5>
-<a name="id36189759"></a>
- <a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.bit_reversal.examples.compile_time_version">Compile-time
- version</a>
- </h5>
-<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">integer</span><span class="special">/</span><span class="identifier">static_bit_reversal</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+</li>
+<li class="listitem">
+<span class="bold"><strong>Compile-time version</strong></span><pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">integer</span><span class="special">/</span><span class="identifier">static_bit_reversal</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span>
@@ -425,6 +434,8 @@
</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">hex</span> <span class="special"><<</span> <span class="identifier">result</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="special">}</span>
</pre>
+</li>
+</ul></div>
</div>
</div>
<div class="section" title="Same Sign">
@@ -432,19 +443,19 @@
<a name="boost_integer.bits_and_ints.same_sign"></a><a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.same_sign" title="Same Sign"> Same Sign</a>
</h3></div></div></div>
<div class="toc"><dl>
-<dt><span class="section"><a href="bits_and_ints.html#boost_integer.bits_and_ints.same_sign.run_time_version">Run-time
- version</a></span></dt>
-<dt><span class="section"><a href="bits_and_ints.html#boost_integer.bits_and_ints.same_sign.compile_time_version">Compile-time
- version</a></span></dt>
+<dt><span class="section"><a href="bits_and_ints.html#boost_integer.bits_and_ints.same_sign.non_member_function__same_sign_">Non-Member
+ Function <code class="computeroutput"><span class="identifier">same_sign</span></code></a></span></dt>
+<dt><span class="section"><a href="bits_and_ints.html#boost_integer.bits_and_ints.same_sign.template_class__static_same_sign___">Template
+ Class <code class="computeroutput"><span class="identifier">static_same_sign</span><span class="special"><></span></code></a></span></dt>
<dt><span class="section">Examples</span></dt>
</dl></div>
<p>
These functions check if wheter the sign of two integers are equal.
</p>
-<div class="section" title="Run-time version">
+<div class="section" title="Non-Member Function same_sign">
<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_integer.bits_and_ints.same_sign.run_time_version"></a><a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.same_sign.run_time_version" title="Run-time version">Run-time
- version</a>
+<a name="boost_integer.bits_and_ints.same_sign.non_member_function__same_sign_"></a><a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.same_sign.non_member_function__same_sign_" title="Non-Member Function same_sign">Non-Member
+ Function <code class="computeroutput"><span class="identifier">same_sign</span></code></a>
</h4></div></div></div>
<p>
The run-time version can be included via <boost/integer/same_sign.hpp>.
@@ -454,10 +465,7 @@
<pre class="programlisting"><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">inline</span> <span class="keyword">bool</span> <span class="identifier">same_sign</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">first</span><span class="special">,</span> <span class="identifier">T</span> <span class="identifier">second</span><span class="special">);</span>
</pre>
-<a name="boost_integer.bits_and_ints.same_sign.run_time_version.parameters"></a><h5>
-<a name="id36190114"></a>
- <a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.same_sign.run_time_version.parameters">Parameters</a>
- </h5>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><span class="bold"><strong>Parameters:</strong></span></li></ul></div>
<div class="informaltable"><table class="table">
<colgroup>
<col>
@@ -489,39 +497,36 @@
</td>
</tr></tbody>
</table></div>
-<a name="boost_integer.bits_and_ints.same_sign.run_time_version.return"></a><h5>
-<a name="id36190215"></a>
- <a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.same_sign.run_time_version.return">Return</a>
- </h5>
-<p>
- <code class="computeroutput"><span class="keyword">false</span></code>: if the signs of first
- and second are different
- </p>
-<p>
- <code class="computeroutput"><span class="keyword">true</span></code>: if the signs are equal
- </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+<span class="bold"><strong>Returns: </strong></span><code class="computeroutput"><span class="keyword">false</span></code>
+ if the signs of first and second are different or <code class="computeroutput"><span class="keyword">true</span></code>
+ if the signs are equal
+ </li>
+<li class="listitem">
+<span class="bold"><strong>Remarks: </strong></span><code class="computeroutput"><span class="identifier">T</span></code>
+ must be an integral type. If this constraint is not met, this function
+ do not participate in overload resolution.
+ </li>
+</ul></div>
</div>
-<div class="section" title="Compile-time version">
+<div class="section" title="Template Class static_same_sign<>">
<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_integer.bits_and_ints.same_sign.compile_time_version"></a><a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.same_sign.compile_time_version" title="Compile-time version">Compile-time
- version</a>
+<a name="boost_integer.bits_and_ints.same_sign.template_class__static_same_sign___"></a><a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.same_sign.template_class__static_same_sign___" title="Template Class static_same_sign<>">Template
+ Class <code class="computeroutput"><span class="identifier">static_same_sign</span><span class="special"><></span></code></a>
</h4></div></div></div>
<p>
The compile-time version can be included via <boost/integer/same_sign.hpp>.
The result will be in <code class="computeroutput"><span class="identifier">value</span></code>
member.
</p>
-<pre class="programlisting"><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="identifier">T</span> <span class="identifier">first</span><span class="special">,</span> <span class="identifier">T</span> <span class="identifier">second</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Enable</span> <span class="special">=</span> <span class="emphasis"><em>implementation-defined</em></span><span class="special">></span>
+<pre class="programlisting"><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="identifier">T</span> <span class="identifier">first</span><span class="special">,</span> <span class="identifier">T</span> <span class="identifier">second</span><span class="special">></span>
<span class="keyword">struct</span> <span class="identifier">static_same_sign</span>
<span class="special">{</span>
<span class="keyword">static</span> <span class="keyword">const</span> <span class="keyword">bool</span> <span class="identifier">value</span> <span class="special">=</span> <span class="emphasis"><em>implementation-defined</em></span><span class="special">;</span>
<span class="special">};</span>
</pre>
-<a name="boost_integer.bits_and_ints.same_sign.compile_time_version.template_parameters"></a><h5>
-<a name="id36190416"></a>
- <a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.same_sign.compile_time_version.template_parameters">Template
- Parameters</a>
- </h5>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><span class="bold"><strong>Template Parameters:</strong></span></li></ul></div>
<div class="informaltable"><table class="table">
<colgroup>
<col>
@@ -566,17 +571,19 @@
</tr>
</tbody>
</table></div>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">
+<span class="bold"><strong>Remarks: </strong></span><code class="computeroutput"><span class="identifier">T</span></code>
+ must be an integral type. If this constraint is not met, this class do
+ not participate in overload resolution.
+ </li></ul></div>
</div>
<div class="section" title="Examples">
<div class="titlepage"><div><div><h4 class="title">
<a name="boost_integer.bits_and_ints.same_sign.examples"></a><a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.same_sign.examples" title="Examples">Examples</a>
</h4></div></div></div>
-<a name="boost_integer.bits_and_ints.same_sign.examples.run_time_version"></a><h5>
-<a name="id36190530"></a>
- <a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.same_sign.examples.run_time_version">Run-time
- version</a>
- </h5>
-<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">integer</span><span class="special">/</span><span class="identifier">same_sign</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+<span class="bold"><strong>Run-time version:</strong></span><pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">integer</span><span class="special">/</span><span class="identifier">same_sign</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span>
@@ -590,11 +597,12 @@
<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">result</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="comment">// false
</span><span class="special">}</span>
</pre>
-<a name="boost_integer.bits_and_ints.same_sign.examples.compile_time_version"></a><h5>
-<a name="id36190900"></a>
- <a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.same_sign.examples.compile_time_version">Compile-time
- version</a>
- </h5>
+</li>
+<li class="listitem"><span class="bold"><strong>Compile-time version:</strong></span></li>
+</ul></div>
+<p>
+
+</p>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">integer</span><span class="special">/</span><span class="identifier">same_sign</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
@@ -607,6 +615,8 @@
<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">result</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="comment">// false
</span><span class="special">}</span>
</pre>
+<p>
+ </p>
</div>
</div>
<div class="section" title="Sign function">
@@ -614,31 +624,26 @@
<a name="boost_integer.bits_and_ints.sign"></a><a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.sign" title="Sign function"> Sign function</a>
</h3></div></div></div>
<div class="toc"><dl>
-<dt><span class="section"><a href="bits_and_ints.html#boost_integer.bits_and_ints.sign.run_time_version">Run-time
- version</a></span></dt>
+<dt><span class="section"><a href="bits_and_ints.html#boost_integer.bits_and_ints.sign.non_member_function__sign_">Non-Member
+ Function <code class="computeroutput"><span class="identifier">sign</span></code></a></span></dt>
<dt><span class="section">Examples</span></dt>
</dl></div>
<p>
The <code class="computeroutput"><span class="identifier">sign</span></code> function check the
signal of integrals.
</p>
-<div class="section" title="Run-time version">
+<div class="section" title="Non-Member Function sign">
<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_integer.bits_and_ints.sign.run_time_version"></a><a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.sign.run_time_version" title="Run-time version">Run-time
- version</a>
+<a name="boost_integer.bits_and_ints.sign.non_member_function__sign_"></a><a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.sign.non_member_function__sign_" title="Non-Member Function sign">Non-Member
+ Function <code class="computeroutput"><span class="identifier">sign</span></code></a>
</h4></div></div></div>
<p>
The run-time version can be included via <boost/integer/sign.hpp>.
- For valid types T, the function <code class="computeroutput"><span class="identifier">sign</span></code>
- will be:
</p>
<pre class="programlisting"><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">int</span> <span class="identifier">sign</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">data</span><span class="special">);</span>
</pre>
-<a name="boost_integer.bits_and_ints.sign.run_time_version.parameters"></a><h5>
-<a name="id36191344"></a>
- <a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.sign.run_time_version.parameters">Parameters</a>
- </h5>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><span class="bold"><strong>Parameters:</strong></span></li></ul></div>
<div class="informaltable"><table class="table">
<colgroup>
<col>
@@ -670,10 +675,7 @@
</td>
</tr></tbody>
</table></div>
-<a name="boost_integer.bits_and_ints.sign.run_time_version.return"></a><h5>
-<a name="id36191421"></a>
- <a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.sign.run_time_version.return">Return</a>
- </h5>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><span class="bold"><strong>Returns:</strong></span></li></ul></div>
<div class="informaltable"><table class="table">
<colgroup>
<col>
@@ -731,16 +733,20 @@
</tr>
</tbody>
</table></div>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">
+<span class="bold"><strong>Remarks: </strong></span><code class="computeroutput"><span class="identifier">T</span></code>
+ must be an integral type. If this constraint is not met, this function
+ do not participate in overload resolution.
+ </li></ul></div>
</div>
<div class="section" title="Examples">
<div class="titlepage"><div><div><h4 class="title">
<a name="boost_integer.bits_and_ints.sign.examples"></a><a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.sign.examples" title="Examples">Examples</a>
</h4></div></div></div>
-<a name="boost_integer.bits_and_ints.sign.examples.run_time_version"></a><h5>
-<a name="id36191577"></a>
- <a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.sign.examples.run_time_version">Run-time
- version</a>
- </h5>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><span class="bold"><strong>Run-time version:</strong></span></li></ul></div>
+<p>
+
+</p>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">integer</span><span class="special">/</span><span class="identifier">sign</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
@@ -754,156 +760,174 @@
<span class="identifier">result</span> <span class="special">=</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">sign</span><span class="special">(</span><span class="identifier">second</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">result</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="comment">// 1
</span>
- <span class="identifier">result</span> <span class="special">=</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">sing</span><span class="special">(</span><span class="identifier">third</span><span class="special">);</span>
+ <span class="identifier">result</span> <span class="special">=</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">sign</span><span class="special">(</span><span class="identifier">third</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">result</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="comment">// 0
</span><span class="special">}</span>
</pre>
+<p>
+ </p>
</div>
</div>
<div class="section" title="Binary Utilities">
<div class="titlepage"><div><div><h3 class="title">
<a name="boost_integer.bits_and_ints.bin_utils"></a><a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.bin_utils" title="Binary Utilities"> Binary Utilities</a>
</h3></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section">Synopsis</span></dt>
+<dt><span class="section"><a href="bits_and_ints.html#boost_integer.bits_and_ints.bin_utils.template_class__set_bit___">Template
+ Class <code class="computeroutput"><span class="identifier">set_bit</span><span class="special"><></span></code></a></span></dt>
+<dt><span class="section"><a href="bits_and_ints.html#boost_integer.bits_and_ints.bin_utils.template_class__clear_bit___">Template
+ Class <code class="computeroutput"><span class="identifier">clear_bit</span><span class="special"><></span></code></a></span></dt>
+<dt><span class="section"><a href="bits_and_ints.html#boost_integer.bits_and_ints.bin_utils.template_class__test_bit___">Template
+ Class <code class="computeroutput"><span class="identifier">test_bit</span><span class="special"><></span></code></a></span></dt>
+<dt><span class="section"><a href="bits_and_ints.html#boost_integer.bits_and_ints.bin_utils.template_class__flip_bit___">Template
+ Class <code class="computeroutput"><span class="identifier">flip_bit</span><span class="special"><></span></code></a></span></dt>
+</dl></div>
<p>
The header <boost/integer/bin_utils.hpp>
cotains some metafunctions to handle binary data. All the metafunctions have
an member varible named <code class="computeroutput"><span class="identifier">value</span></code>
where will be the result.
</p>
-<div class="informaltable"><table class="table">
-<colgroup>
-<col>
-<col>
-<col>
-</colgroup>
-<thead><tr>
-<th>
- <p>
- Metafuntion
- </p>
- </th>
-<th>
- <p>
- Parameters
- </p>
- </th>
-<th>
- <p>
- Description
- </p>
- </th>
-</tr></thead>
-<tbody>
-<tr>
-<td>
- <p>
- set_bit
- </p>
- </td>
-<td>
- <p>
- <code class="computeroutput"><span class="keyword">typename</span> <span class="identifier">T</span></code>,
- <code class="computeroutput"><span class="identifier">T</span> <span class="identifier">data</span></code>,
- <code class="computeroutput"><span class="keyword">unsigned</span> <span class="keyword">char</span>
- <span class="identifier">pos</span></code>
- </p>
- </td>
-<td>
- <p>
- Sets the bit <code class="computeroutput"><span class="identifier">pos</span></code>
- active in <code class="computeroutput"><span class="identifier">data</span></code>.
- </p>
- </td>
-</tr>
-<tr>
-<td>
- <p>
- clear_bit
- </p>
- </td>
-<td>
- <p>
- <code class="computeroutput"><span class="keyword">typename</span> <span class="identifier">T</span></code>,
- <code class="computeroutput"><span class="identifier">T</span> <span class="identifier">data</span></code>,
- <code class="computeroutput"><span class="keyword">unsigned</span> <span class="keyword">char</span>
- <span class="identifier">pos</span></code>
- </p>
- </td>
-<td>
- <p>
- Sets the bit <code class="computeroutput"><span class="identifier">pos</span></code>
- inactive in <code class="computeroutput"><span class="identifier">data</span></code>.
- </p>
- </td>
-</tr>
-<tr>
-<td>
- <p>
- test_bit
- </p>
- </td>
-<td>
- <p>
- <code class="computeroutput"><span class="keyword">typename</span> <span class="identifier">T</span></code>,
- <code class="computeroutput"><span class="identifier">T</span> <span class="identifier">data</span></code>,
- <code class="computeroutput"><span class="keyword">unsigned</span> <span class="keyword">char</span>
- <span class="identifier">pos</span></code>
- </p>
- </td>
-<td>
- <p>
- Test if the bit <code class="computeroutput"><span class="identifier">pos</span></code>
- in <code class="computeroutput"><span class="identifier">data</span></code> is active
- or not.
- </p>
- </td>
-</tr>
-<tr>
-<td>
- <p>
- flip_bit
- </p>
- </td>
-<td>
- <p>
- <code class="computeroutput"><span class="keyword">typename</span> <span class="identifier">T</span></code>,
- <code class="computeroutput"><span class="identifier">T</span> <span class="identifier">data</span></code>,
- <code class="computeroutput"><span class="keyword">unsigned</span> <span class="keyword">char</span>
- <span class="identifier">pos</span></code>
- </p>
- </td>
-<td>
- <p>
- Invert the value of the bit <code class="computeroutput"><span class="identifier">pos</span></code>
- in <code class="computeroutput"><span class="identifier">data</span></code>.
- </p>
- </td>
-</tr>
-<tr>
-<td>
- <p>
- modify_bit
- </p>
- </td>
-<td>
- <p>
- <code class="computeroutput"><span class="keyword">typename</span> <span class="identifier">T</span></code>,
- <code class="computeroutput"><span class="identifier">T</span> <span class="identifier">data</span></code>,
- <code class="computeroutput"><span class="keyword">unsigned</span> <span class="keyword">char</span>
- <span class="identifier">pos</span></code>, <code class="computeroutput"><span class="keyword">bool</span>
- <span class="identifier">state</span></code>
- </p>
- </td>
-<td>
- <p>
- Sets the bit <code class="computeroutput"><span class="identifier">pos</span></code>
- in <code class="computeroutput"><span class="identifier">data</span></code> active if
- <code class="computeroutput"><span class="identifier">state</span></code> is <code class="computeroutput"><span class="keyword">true</span></code> or inactive if <code class="computeroutput"><span class="identifier">state</span></code> is <code class="computeroutput"><span class="keyword">false</span></code>.
- </p>
- </td>
-</tr>
-</tbody>
-</table></div>
+<div class="section" title="Synopsis">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_integer.bits_and_ints.bin_utils.synopsis"></a><a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.bin_utils.synopsis" title="Synopsis">Synopsis</a>
+</h4></div></div></div>
+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span>
+<span class="special">{</span>
+
+<span class="comment">// Sets the bit `pos' in data
+</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="identifier">T</span> <span class="identifier">data</span><span class="special">,</span> <span class="keyword">unsigned</span> <span class="keyword">char</span> <span class="identifier">pos</span><span class="special">></span>
+<span class="keyword">struct</span> <span class="identifier">set_bit</span>
+<span class="special">{</span>
+ <span class="keyword">static</span> <span class="keyword">const</span> <span class="identifier">T</span> <span class="identifier">value</span> <span class="special">=</span> <span class="emphasis"><em>implementation-defined</em></span><span class="special">;</span>
+<span class="special">};</span> <span class="comment">// set_bit
+</span>
+
+<span class="comment">// Clear the bit `pos' in data
+</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="identifier">T</span> <span class="identifier">data</span><span class="special">,</span> <span class="keyword">unsigned</span> <span class="keyword">char</span> <span class="identifier">pos</span><span class="special">></span>
+<span class="keyword">struct</span> <span class="identifier">clear_bit</span>
+<span class="special">{</span>
+ <span class="keyword">static</span> <span class="keyword">const</span> <span class="identifier">T</span> <span class="identifier">value</span> <span class="special">=</span> <span class="emphasis"><em>implementation-defined</em></span><span class="special">;</span>
+<span class="special">};</span> <span class="comment">// clear_bit
+</span>
+<span class="comment">// If the bit `pos' is 1 then it will be 0 if not the bit will be 1
+</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="identifier">T</span> <span class="identifier">data</span><span class="special">,</span> <span class="keyword">unsigned</span> <span class="keyword">char</span> <span class="identifier">pos</span><span class="special">></span>
+<span class="keyword">struct</span> <span class="identifier">flip_bit</span>
+<span class="special">{</span>
+ <span class="keyword">static</span> <span class="keyword">const</span> <span class="identifier">T</span> <span class="identifier">value</span> <span class="special">=</span> <span class="emphasis"><em>implementation-defined</em></span><span class="special">;</span>
+<span class="special">};</span> <span class="comment">// flip_bit
+</span>
+<span class="comment">// Test if the bit in `pos' positon is set or not
+</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="identifier">T</span> <span class="identifier">data</span><span class="special">,</span> <span class="keyword">unsigned</span> <span class="keyword">char</span> <span class="identifier">pos</span><span class="special">></span>
+<span class="keyword">struct</span> <span class="identifier">test_bit</span>
+<span class="special">{</span>
+ <span class="keyword">static</span> <span class="keyword">const</span> <span class="keyword">bool</span> <span class="identifier">value</span> <span class="special">=</span> <span class="emphasis"><em>implementation-defined</em></span><span class="special">;</span>
+<span class="special">};</span> <span class="comment">// test_bit
+</span>
+<span class="special">}</span> <span class="comment">// boost
+</span></pre>
+</div>
+<div class="section" title="Template Class set_bit<>">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_integer.bits_and_ints.bin_utils.template_class__set_bit___"></a><a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.bin_utils.template_class__set_bit___" title="Template Class set_bit<>">Template
+ Class <code class="computeroutput"><span class="identifier">set_bit</span><span class="special"><></span></code></a>
+</h4></div></div></div>
+<p>
+ Sets the bit <code class="computeroutput"><span class="identifier">pos</span></code> active
+ in <code class="computeroutput"><span class="identifier">data</span></code>.
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+<span class="bold"><strong>Requires: </strong></span><code class="computeroutput"><span class="identifier">pos</span></code>
+ must be smaller than the size (in bits) of <code class="computeroutput"><span class="identifier">Type</span></code>.
+ </li>
+<li class="listitem">
+<span class="bold"><strong>Remarks: </strong></span><code class="computeroutput"><span class="identifier">T</span></code>
+ must be an integral type. If this constraint is not met, this metafunction
+ do not participate in overload resolution.
+ </li>
+<li class="listitem"><span class="bold"><strong>Example:</strong></span></li>
+</ul></div>
+<pre class="programlisting"><span class="comment">// `new_value' becomes 101
+</span><span class="keyword">int</span> <span class="identifier">new_value</span> <span class="special">=</span> <span class="identifier">set_bit</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="number">100</span><span class="special">,</span> <span class="number">0</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span>
+</pre>
+</div>
+<div class="section" title="Template Class clear_bit<>">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_integer.bits_and_ints.bin_utils.template_class__clear_bit___"></a><a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.bin_utils.template_class__clear_bit___" title="Template Class clear_bit<>">Template
+ Class <code class="computeroutput"><span class="identifier">clear_bit</span><span class="special"><></span></code></a>
+</h4></div></div></div>
+<p>
+ Sets the bit <code class="computeroutput"><span class="identifier">pos</span></code> inactive
+ in <code class="computeroutput"><span class="identifier">data</span></code>.
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+<span class="bold"><strong>Requires: </strong></span><code class="computeroutput"><span class="identifier">pos</span></code>
+ must be smaller than the size (in bits) of <code class="computeroutput"><span class="identifier">Type</span></code>.
+ </li>
+<li class="listitem">
+<span class="bold"><strong>Remarks: </strong></span><code class="computeroutput"><span class="identifier">T</span></code>
+ must be an integral type. If this constraint is not met, this metafunction
+ do not participate in overload resolution.
+ </li>
+<li class="listitem"><span class="bold"><strong>Example:</strong></span></li>
+</ul></div>
+<pre class="programlisting"><span class="comment">// `new_value' becomes 1
+</span><span class="keyword">int</span> <span class="identifier">new_value</span> <span class="special">=</span> <span class="identifier">set_bit</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="number">3</span><span class="special">,</span> <span class="number">2</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span>
+</pre>
+</div>
+<div class="section" title="Template Class test_bit<>">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_integer.bits_and_ints.bin_utils.template_class__test_bit___"></a><a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.bin_utils.template_class__test_bit___" title="Template Class test_bit<>">Template
+ Class <code class="computeroutput"><span class="identifier">test_bit</span><span class="special"><></span></code></a>
+</h4></div></div></div>
+<p>
+ Test if the bit <code class="computeroutput"><span class="identifier">pos</span></code> in
+ <code class="computeroutput"><span class="identifier">data</span></code> is active or not.
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+<span class="bold"><strong>Requires: </strong></span><code class="computeroutput"><span class="identifier">pos</span></code>
+ must be smaller than the size (in bits) of <code class="computeroutput"><span class="identifier">Type</span></code>.
+ </li>
+<li class="listitem">
+<span class="bold"><strong>Remarks: </strong></span><code class="computeroutput"><span class="identifier">T</span></code>
+ must be an integral type. If this constraint is not met, this metafunction
+ do not participate in overload resolution.
+ </li>
+<li class="listitem"><span class="bold"><strong>Example:</strong></span></li>
+</ul></div>
+<pre class="programlisting"><span class="comment">// `is_set' becomes true
+</span><span class="keyword">bool</span> <span class="identifier">is_set</span> <span class="special">=</span> <span class="identifier">test_bit</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="number">3982</span><span class="special">,</span> <span class="number">11</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span>
+</pre>
+</div>
+<div class="section" title="Template Class flip_bit<>">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_integer.bits_and_ints.bin_utils.template_class__flip_bit___"></a><a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.bin_utils.template_class__flip_bit___" title="Template Class flip_bit<>">Template
+ Class <code class="computeroutput"><span class="identifier">flip_bit</span><span class="special"><></span></code></a>
+</h4></div></div></div>
+<p>
+ Invert the value of the bit <code class="computeroutput"><span class="identifier">pos</span></code>
+ in <code class="computeroutput"><span class="identifier">data</span></code>
+ </p>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+<span class="bold"><strong>Requires: </strong></span><code class="computeroutput"><span class="identifier">pos</span></code>
+ must be smaller than the size (in bits) of <code class="computeroutput"><span class="identifier">Type</span></code>.
+ </li>
+<li class="listitem">
+<span class="bold"><strong>Remarks: </strong></span><code class="computeroutput"><span class="identifier">T</span></code>
+ must be an integral type. If this constraint is not met, this metafunction
+ do not participate in overload resolution.
+ </li>
+<li class="listitem"><span class="bold"><strong>Example:</strong></span></li>
+</ul></div>
+<pre class="programlisting"><span class="comment">// `new_value' becomes 14
+</span><span class="keyword">bool</span> <span class="identifier">new_value</span> <span class="special">=</span> <span class="identifier">flip_bit</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="number">10</span><span class="special">,</span> <span class="number">2</span><span class="special">>::</span><span class="identifier">value</span><span class="special">;</span>
+</pre>
+</div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
Modified: sandbox/SOC/2010/bits_and_ints/libs/integer/doc/html/boost_integer/history.html
==============================================================================
--- sandbox/SOC/2010/bits_and_ints/libs/integer/doc/html/boost_integer/history.html (original)
+++ sandbox/SOC/2010/bits_and_ints/libs/integer/doc/html/boost_integer/history.html 2010-06-13 14:24:32 EDT (Sun, 13 Jun 2010)
@@ -26,7 +26,7 @@
<a name="boost_integer.history"></a><a class="link" href="history.html" title="History"> History</a>
</h2></div></div></div>
<a name="boost_integer.history.1_42_0"></a><h5>
-<a name="id36193799"></a>
+<a name="id36194512"></a>
<a class="link" href="history.html#boost_integer.history.1_42_0">1.42.0</a>
</h5>
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
@@ -55,7 +55,7 @@
</li>
</ul></div>
<a name="boost_integer.history.1_32_0"></a><h5>
-<a name="id36193907"></a>
+<a name="id36194621"></a>
<a class="link" href="history.html#boost_integer.history.1_32_0">1.32.0</a>
</h5>
<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">
Modified: sandbox/SOC/2010/bits_and_ints/libs/integer/doc/html/index.html
==============================================================================
--- sandbox/SOC/2010/bits_and_ints/libs/integer/doc/html/index.html (original)
+++ sandbox/SOC/2010/bits_and_ints/libs/integer/doc/html/index.html 2010-06-13 14:24:32 EDT (Sun, 13 Jun 2010)
@@ -255,7 +255,7 @@
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
-<td align="left"><p><small>Last revised: June 07, 2010 at 19:39:34 GMT</small></p></td>
+<td align="left"><p><small>Last revised: June 13, 2010 at 18:19:49 GMT</small></p></td>
<td align="right"><div class="copyright-footer"></div></td>
</tr></table>
<hr>
Modified: sandbox/SOC/2010/bits_and_ints/libs/integer/doc/integer.qbk
==============================================================================
--- sandbox/SOC/2010/bits_and_ints/libs/integer/doc/integer.qbk (original)
+++ sandbox/SOC/2010/bits_and_ints/libs/integer/doc/integer.qbk 2010-06-13 14:24:32 EDT (Sun, 13 Jun 2010)
@@ -724,308 +724,7 @@
[endsect]
[endsect]
-[section:bits_and_ints Bits and Ints]
-
-The intent of this library is to extend Boost.Integer with fast integer algorithms and utilities. This library can be included via [@../../../../boost/integer/bits_and_ints.hpp <boost/integer/bits_and_ints.hpp>].
-
-[section:sign_extend Sign Extending]
-
-Sign extension is automatic for built-in types, such as chars and ints. But suppose you have a signed two's complement number, x, that is stored
-using only b bits. Moreover, suppose you want to convert x to an int, which has more than b bits. A simple copy will work if x is positive, but if
-negative, the sign must be extended. For example, if we have only 4 bits to store a number, then -3 is represented as 1101 in binary. If we have
-8 bits, then -3 is 11111101. The most-significant bit of the 4-bit representation is replicated sinistrally to fill in the destination when we
-convert to a representation with more bits; this is sign extending.
-
-[section Run-time version]
-The run-time version can be included via [@../../../../boost/integer/sign_extend.hpp <boost/integer/sign_extend.hpp>].
-
- template <typename Type>
- inline typename enable_if<is_integral<Type>, Type>::type
- sign_extend(Type data, std::size_t bits);
-
-[h4 Parameters]
-
-[table
- [[Parameter][Description]]
- [[`data`][ The data to be extended. ]]
- [[`bits`][ The amount of bits in wich data is represented. ]]
-]
-
-[h4 Return]
-`data` sign-extended to `sizeof(Type)` bytes. The return type is `Type`.
-
-[endsect]
-
-[section Compile-time version]
-The compile-time version can be included via [@../../../../boost/integer/static_sign_extend.hpp <boost/integer/static_sign_extend.hpp>].
-The result will be in `value` member.
-
- template<typename Type, Type data, std::size_t Bits,
- class Enable = ``['implementation-defined]``>
- struct static_sign_extend
- {
- static const Type value = ``['implementation-defined]``;
- };
-
-[h4 Template Parameters]
-
-[table
- [[Parameter][Description]]
- [[`Type`][ The data type. ]]
- [[`data`][ The data to be extended. ]]
- [[`Bits`][ The amount of bits in wich data is represented. ]]
-]
-[endsect]
-
-[section Examples]
-[h4 Run-time version]
-
- #include <boost/integer/sign_extend.hpp>
- #include <iostream>
-
- int main()
- {
- // data is represented in 24-bits
- int data = 0xFFFFFF; // -1 in 24-bits
-
- int result = boost::sign_extend(data, 24);
-
- std::cout << result << std::endl; // -1
- }
-
-[h4 Compile-time version]
-
- #include <boost/integer/static_sign_extend.hpp>
- #include <iostream>
-
- int main()
- {
- // 0xFFFFF is -1 in 20-bits
- int result = boost::static_sign_extend<int, 0xFFFFF, 20>::value;
-
- std::cout << result << std::endl; // -1
- }
-
-[endsect]
-
-[endsect]
-
-[section:bit_reversal Bit Reversal]
-The bit reversal functions reverts the bits of integral types.
-
-[section Run-time version]
-The run-time version can be included via [@../../../../boost/integer/bit_reversal.hpp <boost/integer/bit_reversal.hpp>].
-For valid types T, the function `bit_reversal` will be:
-
- template <typename T>
- inline T bit_reversal(T data);
-
-[h4 Parameters]
-
-[table
- [[Parameter][Description]]
- [[`data`][ The data to be reversed. The type of data *must* be an integral type and it's size *must* be 8, 16, 32 or 64-bits, otherwise, bit_reversal(data) will result in an error. ]]
-]
-
-[h4 Return]
-`data` with its bits reversed.
-
-[endsect]
-
-[section Compile-time version]
-The compile-time version can be included via [@../../../../boost/integer/static_bit_reversal.hpp <boost/integer/static_bit_reversal.hpp>].
-The result will be in `value` member.
-
- template <typename T, T data, class Enable = ``['implementation-defined]``>
- struct static_bit_reversal {
- static const Type value = ``['implementation-defined]``;
- };
-
-[h4 Template Parameters]
-
-[table
- [[Parameter][Description]]
- [[`T`][ The data type. ]]
- [[`data`][ The data to be reversed. ]]
-]
-[endsect]
-
-[section Examples]
-[h4 Run-time version]
-
- #include <boost/integer/bit_reversal.hpp>
- #include <iostream>
-
- int main()
- {
- // data = 0101 0101
- uint8_t data = 0x55;
-
- uint8_t result = boost::bit_reversal(data);
-
- // will print 0xaa (1010 1010)
- std::cout << std::hex << result << std::endl; // -1
- }
-
-[h4 Compile-time version]
-
- #include <boost/integer/static_bit_reversal.hpp>
- #include <iostream>
-
- int main()
- {
- // 0x30A5 == 0011 0000 1010 0101
- uint16_t result = boost::static_sign_extend<uint16_t, 0x30A5>::value;
-
- // will print 0x5A0B
- std::cout << std::hex << result << std::endl;
- }
-
-[endsect]
-[endsect]
-
-[section:same_sign Same Sign]
-These functions check if wheter the sign of two integers are equal.
-
-[section Run-time version]
-The run-time version can be included via [@../../../../boost/integer/same_sign.hpp <boost/integer/same_sign.hpp>].
-For valid types T, the function `bit_reversal` will be:
-
- template <typename T>
- inline bool same_sign(T first, T second);
-
-[h4 Parameters]
-
-[table
- [[Parameter][Description]]
- [[`first`, `second`][ The two integral values to be compared. The type of data *must* be an integral type. `first` and `second` must have the same type. ]]
-]
-
-[h4 Return]
-`false`: if the signs of first and second are different
-
-`true`: if the signs are equal
-
-[endsect]
-
-[section Compile-time version]
-The compile-time version can be included via [@../../../../boost/integer/same_sign.hpp <boost/integer/same_sign.hpp>].
-The result will be in `value` member.
-
- template <typename T, T first, T second, class Enable = ``['implementation-defined]``>
- struct static_same_sign
- {
- static const bool value = ``['implementation-defined]``;
- };
-
-[h4 Template Parameters]
-
-[table
- [[Parameter][Description]]
- [[`T`][ The data type. ]]
- [[`first`, `second`][ The two integral values to be compared. ]]
-]
-[endsect]
-
-[section Examples]
-[h4 Run-time version]
-
- #include <boost/integer/same_sign.hpp>
- #include <iostream>
-
- int main()
- {
- int first = -1, second = -2, third = 1;
-
- bool result = boost::same_sign(first, second);
- std::cout << result << std::endl; // true
-
- result = boost::same_sign(first, third);
- std::cout << result << std::endl; // false
- }
-
-[h4 Compile-time version]
-
- #include <boost/integer/same_sign.hpp>
- #include <iostream>
-
- int main()
- {
- bool result = boost::static_same_sign<int, 2, 10>::value;
- std::cout << result << std::endl; //true
-
- result = boost::static_same_sign<int, 10, -2>::value;
- std::cout << result << std::endl; // false
- }
-
-[endsect]
-[endsect]
-
-[section:sign Sign function]
-The `sign` function check the signal of integrals.
-
-[section Run-time version]
-The run-time version can be included via [@../../../../boost/integer/sign.hpp <boost/integer/sign.hpp>].
-For valid types T, the function `sign` will be:
-
- template <typename T>
- int sign(T data);
-
-[h4 Parameters]
-
-[table
- [[Parameter][Description]]
- [[`data`][ The data to be checked. The type of data *must* be an integral otherwise, sign(data) will result in an error. ]]
-]
-
-[h4 Return]
-[table
- [[Value][Description]]
- [[`-1`][ `data` is negative. ]]
- [[`0`][ `data` is equal to zero. ]]
- [[`1`][ `data` is positive. ]]
-]
-
-[endsect]
-
-[section Examples]
-[h4 Run-time version]
-
- #include <boost/integer/sign.hpp>
- #include <iostream>
-
- int main()
- {
- int first = -100, second = 340, third = 0;
-
- int result = boost::sign(first);
- std::cout << result << std::endl; // -1
-
- result = boost::sign(second);
- std::cout << result << std::endl; // 1
-
- result = boost::sing(third);
- std::cout << result << std::endl; // 0
- }
-
-[endsect]
-[endsect]
-
-[section:bin_utils Binary Utilities]
-The header [@../../../../boost/integer/bin_utils.hpp <boost/integer/bin_utils.hpp>] cotains some metafunctions to handle binary data.
-All the metafunctions have an member varible named `value` where will be the result.
-
-[table
- [[Metafuntion][Parameters][Description]]
- [[set_bit][`typename T`, `T data`, `unsigned char pos`][ Sets the bit `pos` active in `data`. ]]
- [[clear_bit][`typename T`, `T data`, `unsigned char pos`][ Sets the bit `pos` inactive in `data`. ]]
- [[test_bit][`typename T`, `T data`, `unsigned char pos`][ Test if the bit `pos` in `data` is active or not. ]]
- [[flip_bit][`typename T`, `T data`, `unsigned char pos`][ Invert the value of the bit `pos` in `data`. ]]
- [[modify_bit][`typename T`, `T data`, `unsigned char pos`, `bool state`][ Sets the bit `pos` in `data` active if `state` is `true` or inactive if `state` is `false`. ]]
-]
-[endsect]
-
-[endsect]
+[include bits_and_ints.qbk]
[section:minmax Compile time min/max calculation]
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk