Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r64821 - in sandbox/SOC/2010/bits_and_ints: boost/integer libs/integer/doc libs/integer/doc/html libs/integer/doc/html/boost_integer libs/integer/example
From: muriloufg_at_[hidden]
Date: 2010-08-15 11:49:38


Author: murilov
Date: 2010-08-15 11:49:31 EDT (Sun, 15 Aug 2010)
New Revision: 64821
URL: http://svn.boost.org/trac/boost/changeset/64821

Log:
A bit of doc changes
Text files modified:
   sandbox/SOC/2010/bits_and_ints/boost/integer/interleave.hpp | 2 +-
   sandbox/SOC/2010/bits_and_ints/libs/integer/doc/bits_and_ints.qbk | 34 ++++++++++++++++++----------------
   sandbox/SOC/2010/bits_and_ints/libs/integer/doc/html/boost_integer/bits_and_ints.html | 22 +++++++++++++---------
   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/example/ilog2_policy_example.cpp | 2 +-
   6 files changed, 36 insertions(+), 30 deletions(-)

Modified: sandbox/SOC/2010/bits_and_ints/boost/integer/interleave.hpp
==============================================================================
--- sandbox/SOC/2010/bits_and_ints/boost/integer/interleave.hpp (original)
+++ sandbox/SOC/2010/bits_and_ints/boost/integer/interleave.hpp 2010-08-15 11:49:31 EDT (Sun, 15 Aug 2010)
@@ -124,7 +124,7 @@
                 b |= ((number & (1 << (i + 1)))) >> ((i >> 1) + 1);
         }
         
- return make_pair(a, b);
+ return std::make_pair(a, b);
 } // uninterleave
 
 } // boost

Modified: sandbox/SOC/2010/bits_and_ints/libs/integer/doc/bits_and_ints.qbk
==============================================================================
--- sandbox/SOC/2010/bits_and_ints/libs/integer/doc/bits_and_ints.qbk (original)
+++ sandbox/SOC/2010/bits_and_ints/libs/integer/doc/bits_and_ints.qbk 2010-08-15 11:49:31 EDT (Sun, 15 Aug 2010)
@@ -175,15 +175,19 @@
 
 [section Synopsis]
 ``
-T2 interleave(T1 x, T1 y);
+template <int Bits>
+typename uint_t<Bits * 2>::exact>::type
+interleave(typename uint_t<Bits>::exact x, typename uint_t<Bits>::exact y);
 
-std::pair<T1, T1> uninterleave(T2 number);
+template <int Bits>
+std::pair<typename uint_t<Bits/2>::exact, typename uint_t<Bits/2>::exact> >::type
+uninterleave(typename uint_t<Bits>::exact number);
 ``
 [endsect]
 
 
-*[*Requires: ] `T1` and `T2` must be integral types. Additionally, `T1` must have 8, 16 or 32 bits and `T2` must have
-16, 32 or 64 bits. For these functions `T2` have the double of bits of `T1`.
+*[*Requires: ] The parameters must be integral types. Additionally, for the `interleave` function, `Bits` must be 8, 16 or 32. For `uninterleave` function `Bits` must be
+16, 32 or 64.
 
 [*Returns: ] `interleave` function returns `x` and `y` interleaved. `x` will be in the even bits and `y` will be on odd positions, so the return type have the double of bits than the paramter's type.
 
@@ -193,27 +197,25 @@
 [section Examples]
 
 ``
-#include <boost/integer/interleave.hpp>
 #include <utility>
 #include <iostream>
+#include <boost/cstdint.hpp>
+#include <boost/integer.hpp>
+#include <boost/integer/interleave.hpp>
 
-using namespace std;
 using namespace boost;
 
 int main()
 {
- uint_t<64>::exact inter = interleave<32>(0x10, 0x0e);
-
- cout << "interleaved number: ";
- cout << hex << inter << endl;
+ uint_t<32>::exact inter = interleave<16>(0x10, 0x0e);
+ std::cout << std::hex << inter << std::endl; // 1a8
 
- pair<uint8_t, uint8_t> uninter = uninterleave<16>(inter);
+ std::pair<uint16_t, uint16_t> uninter = uninterleave<32>(inter);
+ std::cout << std::hex << uninter.first << " " << uninter.second << std::endl; // 10 e
         
- uint8_t a = uninter.first, b = uninter.second;
-
- cout << "uninterleaved number: ";
- cout << hex << unsigned(a) << " " << unsigned(b) << endl;
+ return 0;
 }
+
 ``
 
 [endsect]
@@ -508,7 +510,7 @@
         }
         
         try {
- // Here an exception is threw
+ // Throws an exception
                 std::cout << boost::ilog2(0u, throw_pol) << std::endl;
         }
         catch (std::domain_error& e) {

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-08-15 11:49:31 EDT (Sun, 15 Aug 2010)
@@ -372,20 +372,24 @@
 <p>
           
 </p>
-<pre class="programlisting"><span class="identifier">T2</span> <span class="identifier">interleave</span><span class="special">(</span><span class="identifier">T1</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">T1</span> <span class="identifier">y</span><span class="special">);</span>
-
-<span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">,</span> <span class="identifier">T1</span><span class="special">&gt;</span> <span class="identifier">uninterleave</span><span class="special">(</span><span class="identifier">T2</span> <span class="identifier">number</span><span class="special">);</span>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">int</span> <span class="identifier">Bits</span><span class="special">&gt;</span>
+<span class="keyword">typename</span> <span class="identifier">uint_t</span><span class="special">&lt;</span><span class="identifier">Bits</span> <span class="special">*</span> <span class="number">2</span><span class="special">&gt;::</span><span class="identifier">exact</span><span class="special">&gt;::</span><span class="identifier">type</span>
+<span class="identifier">interleave</span><span class="special">(</span><span class="keyword">typename</span> <span class="identifier">uint_t</span><span class="special">&lt;</span><span class="identifier">Bits</span><span class="special">&gt;::</span><span class="identifier">exact</span> <span class="identifier">x</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">uint_t</span><span class="special">&lt;</span><span class="identifier">Bits</span><span class="special">&gt;::</span><span class="identifier">exact</span> <span class="identifier">y</span><span class="special">);</span>
+
+<span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">int</span> <span class="identifier">Bits</span><span class="special">&gt;</span>
+<span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">uint_t</span><span class="special">&lt;</span><span class="identifier">Bits</span><span class="special">/</span><span class="number">2</span><span class="special">&gt;::</span><span class="identifier">exact</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">uint_t</span><span class="special">&lt;</span><span class="identifier">Bits</span><span class="special">/</span><span class="number">2</span><span class="special">&gt;::</span><span class="identifier">exact</span><span class="special">&gt;</span> <span class="special">&gt;::</span><span class="identifier">type</span>
+<span class="identifier">uninterleave</span><span class="special">(</span><span class="keyword">typename</span> <span class="identifier">uint_t</span><span class="special">&lt;</span><span class="identifier">Bits</span><span class="special">&gt;::</span><span class="identifier">exact</span> <span class="identifier">number</span><span class="special">);</span>
 </pre>
 <p>
         </p>
 </div>
 <div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">
-<span class="bold"><strong>Requires: </strong></span><code class="computeroutput"><span class="identifier">T1</span></code>
- and <code class="computeroutput"><span class="identifier">T2</span></code> must be integral
- types. Additionally, <code class="computeroutput"><span class="identifier">T1</span></code>
- must have 8, 16 or 32 bits and <code class="computeroutput"><span class="identifier">T2</span></code>
- must have 16, 32 or 64 bits. For these functions <code class="computeroutput"><span class="identifier">T2</span></code>
- have the double of bits of <code class="computeroutput"><span class="identifier">T1</span></code>.
+<span class="bold"><strong>Requires: </strong></span> The parameters must be integral
+ types. Additionally, for the <code class="computeroutput"><span class="identifier">interleave</span></code>
+ function, <code class="computeroutput"><span class="identifier">Bits</span></code> must be
+ 8, 16 or 32. For <code class="computeroutput"><span class="identifier">uninterleave</span></code>
+ function <code class="computeroutput"><span class="identifier">Bits</span></code> must be 16,
+ 32 or 64.
         </li></ul></div>
 <p>
         <span class="bold"><strong>Returns: </strong></span> <code class="computeroutput"><span class="identifier">interleave</span></code>

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-08-15 11:49:31 EDT (Sun, 15 Aug 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="id36206880"></a>
+<a name="id36207091"></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="id36207000"></a>
+<a name="id36207212"></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-08-15 11:49:31 EDT (Sun, 15 Aug 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: August 14, 2010 at 14:57:55 GMT</small></p></td>
+<td align="left"><p><small>Last revised: August 15, 2010 at 15:35:29 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/example/ilog2_policy_example.cpp
==============================================================================
--- sandbox/SOC/2010/bits_and_ints/libs/integer/example/ilog2_policy_example.cpp (original)
+++ sandbox/SOC/2010/bits_and_ints/libs/integer/example/ilog2_policy_example.cpp 2010-08-15 11:49:31 EDT (Sun, 15 Aug 2010)
@@ -52,7 +52,7 @@
         }
         
         try {
- // Here an exception is threw
+ // Throw an exception
                 std::cout << boost::ilog2(0u, throw_pol) << std::endl;
         }
         catch (std::domain_error& e) {


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