Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r64139 - sandbox/SOC/2010/bit_masks/boost/integer/detail/bft
From: bbartmanboost_at_[hidden]
Date: 2010-07-18 13:16:28


Author: bbartman
Date: 2010-07-18 13:16:27 EDT (Sun, 18 Jul 2010)
New Revision: 64139
URL: http://svn.boost.org/trac/boost/changeset/64139

Log:
working on implementing the bitfield_tuples pointer memeber extension
Text files modified:
   sandbox/SOC/2010/bit_masks/boost/integer/detail/bft/arg_parse_impl.hpp | 18 ++++++++++++++++--
   sandbox/SOC/2010/bit_masks/boost/integer/detail/bft/pointer_packing_policy.hpp | 11 ++++++-----
   2 files changed, 22 insertions(+), 7 deletions(-)

Modified: sandbox/SOC/2010/bit_masks/boost/integer/detail/bft/arg_parse_impl.hpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/boost/integer/detail/bft/arg_parse_impl.hpp (original)
+++ sandbox/SOC/2010/bit_masks/boost/integer/detail/bft/arg_parse_impl.hpp 2010-07-18 13:16:27 EDT (Sun, 18 Jul 2010)
@@ -453,6 +453,20 @@
  
     typedef bitfields::pointer< ReturnType, Name, Mask > param;
 
+ // if the offset is greater then then number of storage bits
+ // the this pointer is not going to be aligned within storage.
+ typedef typename mpl::if_<
+ mpl::greater<Offset, front_storage_space>,
+ mpl::false_,
+ mpl::true_
+ >::type is_aligned;
+
+ //
+ typedef typename mpl::if_<is_aligned,
+ bit_shift::none,
+ bit_shift::right< mpl::minus<Offset, front_storage_space>::type::value >
+ >::type alignment_shift;
+
     typedef StoragePolicy storage_policy;
     typedef typename mpl::push_back<
         FieldVector,
@@ -467,8 +481,8 @@
                 ReturnType*,
                 offset,
                 size_of_storage,
- mpl::true_,
- bit_shift::none
+ is_aligned,
+ alignment_shift
>
>
>::type field_vector;

Modified: sandbox/SOC/2010/bit_masks/boost/integer/detail/bft/pointer_packing_policy.hpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/boost/integer/detail/bft/pointer_packing_policy.hpp (original)
+++ sandbox/SOC/2010/bit_masks/boost/integer/detail/bft/pointer_packing_policy.hpp 2010-07-18 13:16:27 EDT (Sun, 18 Jul 2010)
@@ -6,14 +6,15 @@
 
 #ifndef BOOST_BITFIELD_TUPLE_POINTER_PACKING_POLICY_HPP
 #define BOOST_BITFIELD_TUPLE_POINTER_PACKING_POLICY_HPP
+#include <cstddef>
 
-namespace boost { namespace detail {
+namespace boost { namespace detail { namespace bit_shift {
 
-namespace bit_shift {
-struct right;
-struct left;
+template <std::size_t Shift> struct right;
+template <std::size_t Shift> struct left;
 struct none;
-}
+
+} // end bit_shift
 
 template <
     typename Mask,


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