Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r63818 - sandbox/SOC/2010/bit_masks/boost/integer
From: bbartmanboost_at_[hidden]
Date: 2010-07-10 12:28:45


Author: bbartman
Date: 2010-07-10 12:28:44 EDT (Sat, 10 Jul 2010)
New Revision: 63818
URL: http://svn.boost.org/trac/boost/changeset/63818

Log:
fixing error for high and low bits mask types
Text files modified:
   sandbox/SOC/2010/bit_masks/boost/integer/bits_mask.hpp | 1 -
   sandbox/SOC/2010/bit_masks/boost/integer/high_bits_mask.hpp | 6 ++++--
   sandbox/SOC/2010/bit_masks/boost/integer/low_bits_mask.hpp | 7 +++++--
   3 files changed, 9 insertions(+), 5 deletions(-)

Modified: sandbox/SOC/2010/bit_masks/boost/integer/bits_mask.hpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/boost/integer/bits_mask.hpp (original)
+++ sandbox/SOC/2010/bit_masks/boost/integer/bits_mask.hpp 2010-07-10 12:28:44 EDT (Sat, 10 Jul 2010)
@@ -8,7 +8,6 @@
 #define BOOST_BITS_MASK_HPP
 #include <boost/integer/high_bits_mask.hpp>
 #include <boost/integer/low_bits_mask.hpp>
-#include <boost/type_traits.hpp>
 #include <boost/static_assert.hpp>
 #include <boost/integer/bit_width.hpp>
 

Modified: sandbox/SOC/2010/bit_masks/boost/integer/high_bits_mask.hpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/boost/integer/high_bits_mask.hpp (original)
+++ sandbox/SOC/2010/bit_masks/boost/integer/high_bits_mask.hpp 2010-07-10 12:28:44 EDT (Sat, 10 Jul 2010)
@@ -8,9 +8,11 @@
 #ifndef BOOST_HIGH_BITS_MASK_HPP
 #define BOOST_HIGH_BITS_MASK_HPP
 
-#include <boost/type_traits.hpp>
+// #include <boost/type_traits.hpp>
 #include <boost/integer/details/high_low_impl.hpp>
 #include <boost/integer/integral_mask.hpp>
+#include <boost/type_traits/integral_constant.hpp>
+#include <boost/type_traits/make_unsigned.hpp>
 
 namespace boost {
 
@@ -21,7 +23,7 @@
 template <typename T, unsigned int Width>
 struct high_bits_mask
     :details::high_bits_preconditions<T,Width>,
- integral_mask<T, ~(~T(0) >> Width) >
+ integral_mask<T, ~( ~ (typename make_unsigned<T>::type(0)) >> Width) >
 {
     typedef high_bits_mask<T,Width> type;
 

Modified: sandbox/SOC/2010/bit_masks/boost/integer/low_bits_mask.hpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/boost/integer/low_bits_mask.hpp (original)
+++ sandbox/SOC/2010/bit_masks/boost/integer/low_bits_mask.hpp 2010-07-10 12:28:44 EDT (Sat, 10 Jul 2010)
@@ -8,9 +8,12 @@
 #ifndef BOOST_LOW_BITS_MASK_HPP
 #define BOOST_LOW_BITS_MASK_HPP
 
-#include <boost/type_traits.hpp>
+// #include <boost/type_traits.hpp>
 #include <boost/integer/details/high_low_impl.hpp>
 #include <boost/integer/integral_mask.hpp>
+#include <boost/type_traits/integral_constant.hpp>
+#include <boost/type_traits/make_unsigned.hpp>
+
 
 namespace boost {
 
@@ -20,7 +23,7 @@
 template <typename T, unsigned int Width>
 struct low_bits_mask
     :details::low_bits_preconditions<T,Width>,
- integral_mask<T, ~(~T(0) << Width) >
+ integral_mask<T, ~(~ (typename make_unsigned<T>::type(0)) << Width) >
 {
     typedef low_bits_mask<T,Width> type;
 


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