Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r62417 - in sandbox/SOC/2010/bits_and_ints/boost/integer: . detail
From: muriloufg_at_[hidden]
Date: 2010-06-03 16:25:03


Author: murilov
Date: 2010-06-03 16:25:02 EDT (Thu, 03 Jun 2010)
New Revision: 62417
URL: http://svn.boost.org/trac/boost/changeset/62417

Log:
Changed the file utils.hpp to bit_utils.hpp
Changed the name of is_bit_set template to test_bit
Deleted the static_bit_reversal_base. Now using integral_constant from Type Traits library.
Text files modified:
   sandbox/SOC/2010/bits_and_ints/boost/integer/bit_reversal.hpp | 2 +-
   sandbox/SOC/2010/bits_and_ints/boost/integer/bits_and_ints.hpp | 5 +++--
   sandbox/SOC/2010/bits_and_ints/boost/integer/detail/static_bit_reversal.hpp | 4 ++--
   sandbox/SOC/2010/bits_and_ints/boost/integer/sign_extend.hpp | 4 ++--
   sandbox/SOC/2010/bits_and_ints/boost/integer/static_bit_reversal.hpp | 3 +--
   sandbox/SOC/2010/bits_and_ints/boost/integer/static_sign_extend.hpp | 16 ++++++++++++++++
   6 files changed, 25 insertions(+), 9 deletions(-)

Modified: sandbox/SOC/2010/bits_and_ints/boost/integer/bit_reversal.hpp
==============================================================================
--- sandbox/SOC/2010/bits_and_ints/boost/integer/bit_reversal.hpp (original)
+++ sandbox/SOC/2010/bits_and_ints/boost/integer/bit_reversal.hpp 2010-06-03 16:25:02 EDT (Thu, 03 Jun 2010)
@@ -11,7 +11,7 @@
 #define BOOST_BIT_REVERSAL_INCLUDED
 
 #include <boost/utility/enable_if.hpp>
-#include <boost/type_traits.hpp>
+#include <boost/type_traits/is_integral.hpp>
 
 namespace boost
 {

Modified: sandbox/SOC/2010/bits_and_ints/boost/integer/bits_and_ints.hpp
==============================================================================
--- sandbox/SOC/2010/bits_and_ints/boost/integer/bits_and_ints.hpp (original)
+++ sandbox/SOC/2010/bits_and_ints/boost/integer/bits_and_ints.hpp 2010-06-03 16:25:02 EDT (Thu, 03 Jun 2010)
@@ -10,8 +10,9 @@
 #ifndef BOOST_BITS_AND_INTS
 #define BOOST_BITS_AND_INTS
 
-// sign_extends and static_sign_extends
-#include <boost/integer/utils.hpp>
+// Bit and Ints library forwarder
+
+#include <boost/integer/bit_utils.hpp>
 #include <boost/integer/sign_extend.hpp>
 #include <boost/integer/static_sign_extend.hpp>
 #include <boost/integer/bit_reversal.hpp>

Modified: sandbox/SOC/2010/bits_and_ints/boost/integer/detail/static_bit_reversal.hpp
==============================================================================
--- sandbox/SOC/2010/bits_and_ints/boost/integer/detail/static_bit_reversal.hpp (original)
+++ sandbox/SOC/2010/bits_and_ints/boost/integer/detail/static_bit_reversal.hpp 2010-06-03 16:25:02 EDT (Thu, 03 Jun 2010)
@@ -11,7 +11,7 @@
 #define BOOST_DETAIL_STATIC_BIT_REVERSAL_INCLUDED
 
 #include <boost/type_traits/integral_constant.hpp>
-#include <boost/integer/utils.hpp>
+#include <boost/integer/bit_utils.hpp>
 
 namespace boost {
 namespace integer_detail {
@@ -20,7 +20,7 @@
 template <typename T, T data, std::size_t shift>
 struct static_bit_reversal_impl :
         public integral_constant<T,
- ((is_bit_set<T, data, (sizeof(T) * 8 - shift)>::value << (shift - 1))
+ ((test_bit<T, data, (sizeof(T) * 8 - shift)>::value << (shift - 1))
                  + static_bit_reversal_impl<T, data, shift - 1>::value)
>
 {};

Modified: sandbox/SOC/2010/bits_and_ints/boost/integer/sign_extend.hpp
==============================================================================
--- sandbox/SOC/2010/bits_and_ints/boost/integer/sign_extend.hpp (original)
+++ sandbox/SOC/2010/bits_and_ints/boost/integer/sign_extend.hpp 2010-06-03 16:25:02 EDT (Thu, 03 Jun 2010)
@@ -10,8 +10,8 @@
 #ifndef BOOST_SIGN_EXTEND_INCLUDED
 #define BOOST_SIGN_EXTEND_INCLUDED
 
-#include <boost/type_traits.hpp> // is_integral
-#include <boost/utility/enable_if.hpp> // enable_if
+#include <boost/type_traits/is_integral.hpp>
+#include <boost/utility/enable_if.hpp>
 
 namespace boost
 {

Modified: sandbox/SOC/2010/bits_and_ints/boost/integer/static_bit_reversal.hpp
==============================================================================
--- sandbox/SOC/2010/bits_and_ints/boost/integer/static_bit_reversal.hpp (original)
+++ sandbox/SOC/2010/bits_and_ints/boost/integer/static_bit_reversal.hpp 2010-06-03 16:25:02 EDT (Thu, 03 Jun 2010)
@@ -11,8 +11,7 @@
 #define BOOST_STATIC_BIT_REVERSAL_INCLUDED
 
 #include <boost/utility/enable_if.hpp>
-#include <boost/type_traits.hpp>
-#include <boost/integer/utils.hpp>
+#include <boost/type_traits/is_integral.hpp>
 #include <boost/integer/detail/static_bit_reversal.hpp>
 
 /*

Modified: sandbox/SOC/2010/bits_and_ints/boost/integer/static_sign_extend.hpp
==============================================================================
--- sandbox/SOC/2010/bits_and_ints/boost/integer/static_sign_extend.hpp (original)
+++ sandbox/SOC/2010/bits_and_ints/boost/integer/static_sign_extend.hpp 2010-06-03 16:25:02 EDT (Thu, 03 Jun 2010)
@@ -13,6 +13,22 @@
 #include <boost/utility/enable_if.hpp>
 #include <boost/type_traits/is_integral.hpp>
 
+/*
+ * Extend `data' represented in `Bits' bits to sizeof(Type) * 8
+ * in compile-time.
+ *
+ * For example if binary representation of `data' in 4 bits is:
+ * 00000000000000000000000000001010
+ *
+ * So, `data' is -6 in 4-bit 2-complement.
+ *
+ * If type is a 32-bit integral,
+ * static_sign_extend<type, data, 4>::value in 2-complement is:
+ * 11111111111111111111111111111010
+ *
+ * Wich is -6 in 32-bit 2-complement.
+ */
+
 namespace boost
 {
 


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