Boost logo

Boost-Commit :

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


Author: bbartman
Date: 2010-05-07 17:55:54 EDT (Fri, 07 May 2010)
New Revision: 61849
URL: http://svn.boost.org/trac/boost/changeset/61849

Log:
Stubbing out ideas about how to effectivly structure bit_mask implementation
Text files modified:
   sandbox/SOC/2010/bit_masks/boost/integer/bit_mask.hpp | 28 ++++++++++++++++++++++++++--
   sandbox/SOC/2010/bit_masks/boost/integer/details/bit_mask_impl.hpp | 10 ++++++++++
   2 files changed, 36 insertions(+), 2 deletions(-)

Modified: sandbox/SOC/2010/bit_masks/boost/integer/bit_mask.hpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/boost/integer/bit_mask.hpp (original)
+++ sandbox/SOC/2010/bit_masks/boost/integer/bit_mask.hpp 2010-05-07 17:55:54 EDT (Fri, 07 May 2010)
@@ -10,11 +10,35 @@
 #define BOOST_INTEGER_BIT_MASK_HPP
 
 #include <boost/mpl/int.hpp>
+#include <boost/mpl/bitwise.hpp>
+
+#include <boost/integer/details/bit_mask_impl.hpp>
 
 namespace boost {
 
-// template <typename TypeWidth, typename BitOffset, typename MaskWidth>
-// struct
+// forward declaration of the bit mask structure which will all
+// a recursive definition of how
+template <typename Value, typename SecondValue = mpl::int_<0> > struct bit_mask;
+
+
+// termination specialization this will cause the psudo-recursive definition
+// being evalueated to finish.
+template <int NewMaskValue, int CurrentMaskValue>
+struct bit_mask< mpl::int_< NewMaskValue >, mpl::int_< CurrentMaskValue > >
+ :mpl::bitor_<
+ mpl::int_<NewMaskValue>,
+ mpl::int_< CurrentMaskValue >
+ >::type
+{ };
+
+// this is the recursive step for the bit_mask.
+template <int MaskValue, int CurrentMaskValue>
+struct bit_mask < bit_mask< mpl::int_<MaskValue> >, mpl::int_<CurrentMaskValue> >
+ :mpl::bitor_<
+ mpl::int_< CurrentMaskValue >,
+ bit_mask< mpl::int_< MaskValue > >
+ >::type
+{};
 
 } // namespace boost
 

Modified: sandbox/SOC/2010/bit_masks/boost/integer/details/bit_mask_impl.hpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/boost/integer/details/bit_mask_impl.hpp (original)
+++ sandbox/SOC/2010/bit_masks/boost/integer/details/bit_mask_impl.hpp 2010-05-07 17:55:54 EDT (Fri, 07 May 2010)
@@ -0,0 +1,10 @@
+#ifndef BOOST_BIT_MASK_IMPL_HPP
+#define BOOST_BIT_MASK_IMPL_HPP
+
+
+namespace boost { namespace details {
+
+} // end of details namespace.
+} // end of boost namespace.
+
+#endif


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