Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r62054 - in sandbox/SOC/2010/bit_masks/boost/integer: . details
From: bbartmanboost_at_[hidden]
Date: 2010-05-17 08:12:07


Author: bbartman
Date: 2010-05-17 08:12:06 EDT (Mon, 17 May 2010)
New Revision: 62054
URL: http://svn.boost.org/trac/boost/changeset/62054

Log:
started working on utility operators for bit masks.
Text files modified:
   sandbox/SOC/2010/bit_masks/boost/integer/details/bit_mask_function_support.hpp | 12 +++++++-----
   sandbox/SOC/2010/bit_masks/boost/integer/high_low_bits.hpp | 6 +++++-
   2 files changed, 12 insertions(+), 6 deletions(-)

Modified: sandbox/SOC/2010/bit_masks/boost/integer/details/bit_mask_function_support.hpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/boost/integer/details/bit_mask_function_support.hpp (original)
+++ sandbox/SOC/2010/bit_masks/boost/integer/details/bit_mask_function_support.hpp 2010-05-17 08:12:06 EDT (Mon, 17 May 2010)
@@ -6,6 +6,8 @@
 
 #ifndef BOOST_BIT_MASK_FREE_FUNCTION_SUPPORT_HPP
 #define BOOST_BIT_MASK_FREE_FUNCTION_SUPPORT_HPP
+#include <boost/utility/enable_if.hpp>
+
 
 namespace boost {
 
@@ -13,9 +15,9 @@
 // and applications there of.
 
 // Overloads for bitwise and
-template <typename T, typename Mask>
-inline T operator&(T t, Mask) {
- return t & Mask::value;
+template <typename T, unsigned int Offset, unsigned int Width>
+inline T operator&(T t, bit_mask<T,Offset,Width> ) {
+ return t & bit_mask<T,Offset,Width>::value;
 }
 
 template <typename Mask, typename T>
@@ -24,8 +26,8 @@
 }
 
 // Overloads for bitwise or
-template <typename T, typename Mask>
-inline T operator|(T t, Mask) {
+template <typename T, typename Mask >
+inline T operator|(T t, Mask m) {
     return t | Mask::value;
 }
 

Modified: sandbox/SOC/2010/bit_masks/boost/integer/high_low_bits.hpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/boost/integer/high_low_bits.hpp (original)
+++ sandbox/SOC/2010/bit_masks/boost/integer/high_low_bits.hpp 2010-05-17 08:12:06 EDT (Mon, 17 May 2010)
@@ -23,7 +23,9 @@
     :details::low_bits_preconditions<T,Width>,
     integral_mask<T, ~(~T(0) << Width) >
 {
- typedef low_bits<T,Width> type;
+ typedef low_bits<T,Width> type;
+
+ BOOST_STATIC_CONSTANT(unsigned int, width = Width);
 };
 
 /** Creates a mask of the supplied width in side type T, from the lower portion
@@ -35,6 +37,8 @@
     integral_mask<T, ~(~T(0) >> Width) >
 {
     typedef high_bits<T,Width> type;
+
+ BOOST_STATIC_CONSTANT(unsigned int, width = Width);
 };
 
 


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