Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r61778 - in sandbox/hash/boost/hash: . detail
From: me22.ca+boost_at_[hidden]
Date: 2010-05-04 17:46:50


Author: smcmurray
Date: 2010-05-04 17:46:48 EDT (Tue, 04 May 2010)
New Revision: 61778
URL: http://svn.boost.org/trac/boost/changeset/61778

Log:
hash: finish moving the packing code to iterator-based interfaces; remove a bunch of code duplication from the imploders and exploders; remove pointer-assuming optimizations
Text files modified:
   sandbox/hash/boost/hash/detail/exploder.hpp | 177 ++++++++++++++++++---------------------
   sandbox/hash/boost/hash/detail/imploder.hpp | 148 ++++++++++++++------------------
   sandbox/hash/boost/hash/pack.hpp | 119 +++++++-------------------
   sandbox/hash/boost/hash/stream_preprocessor.hpp | 2
   4 files changed, 181 insertions(+), 265 deletions(-)

Modified: sandbox/hash/boost/hash/detail/exploder.hpp
==============================================================================
--- sandbox/hash/boost/hash/detail/exploder.hpp (original)
+++ sandbox/hash/boost/hash/detail/exploder.hpp 2010-05-04 17:46:48 EDT (Tue, 04 May 2010)
@@ -25,127 +25,114 @@
 
 template <typename Endianness,
           int InputBits, int OutputBits,
- int k = 0>
-struct exploder;
-
-template <int UnitBits, int InputBits, int OutputBits,
           int k>
-struct exploder<stream_endian::big_unit_big_bit<UnitBits>,
- InputBits, OutputBits, k> {
- // If this fires, you probably want stream_endian::big_bit instead
- // of big_byte_big_bit or big_octet_big_bit
- BOOST_STATIC_ASSERT(!(InputBits % UnitBits && UnitBits % InputBits ) &&
- !(OutputBits % UnitBits && UnitBits % OutputBits));
- template <typename OutputValue, typename InputValue>
- static void step(OutputValue &z, InputValue x) {
- InputValue y = unbounded_shr<InputBits - (OutputBits+k)>(x);
- z = OutputValue(low_bits<OutputBits>(y));
- }
- template <typename OutputType, typename InputValue>
- static void explode1_array(OutputType &out, unsigned &i, InputValue x) {
- step(out[i++], x);
- exploder<stream_endian::big_unit_big_bit<UnitBits>,
- InputBits, OutputBits, k+OutputBits>
- ::explode1_array(out, i, x);
- }
-};
-template <int UnitBits, int InputBits, int OutputBits>
-struct exploder<stream_endian::big_unit_big_bit<UnitBits>,
- InputBits, OutputBits, InputBits> {
- template <typename OutputType, typename IntputValue>
- static void explode1_array(OutputType &, unsigned &, IntputValue) {}
+struct exploder_step;
+
+template <int UnitBits, int InputBits, int OutputBits, int k>
+struct exploder_step<stream_endian::big_unit_big_bit<UnitBits>,
+ InputBits, OutputBits, k> {
+ template <typename InputValue, typename OutIter>
+ static void step(InputValue const &x, OutIter &out) {
+ int const shift = InputBits - (OutputBits+k);
+ typedef typename std::iterator_traits<OutIter>::value_type OutValue;
+ InputValue y = unbounded_shr<shift>(x);
+ *out++ = OutValue(low_bits<OutputBits>(y));
+ }
 };
 
-template <int UnitBits, int InputBits, int OutputBits,
- int k>
-struct exploder<stream_endian::little_unit_big_bit<UnitBits>,
- InputBits, OutputBits, k> {
- BOOST_STATIC_ASSERT(!((InputBits % UnitBits) && (UnitBits % InputBits )) &&
- !((OutputBits % UnitBits) && (UnitBits % OutputBits)));
- template <typename OutputValue, typename InputValue>
- static void step(OutputValue &z, InputValue x) {
+template <int UnitBits, int InputBits, int OutputBits, int k>
+struct exploder_step<stream_endian::little_unit_big_bit<UnitBits>,
+ InputBits, OutputBits, k> {
+ template <typename InputValue, typename OutIter>
+ static void step(InputValue const &x, OutIter &out) {
         int const kb = (k % UnitBits);
         int const ku = k - kb;
         int const shift =
             OutputBits >= UnitBits ? k :
             InputBits >= UnitBits ? ku + (UnitBits-(OutputBits+kb)) :
                                      InputBits - (OutputBits+kb);
+ typedef typename std::iterator_traits<OutIter>::value_type OutValue;
         InputValue y = unbounded_shr<shift>(x);
- z = OutputValue(low_bits<OutputBits>(y));
- }
- template <typename OutputType, typename InputValue>
- static void explode1_array(OutputType &out, unsigned &i, InputValue x) {
- step(out[i++], x);
- exploder<stream_endian::little_unit_big_bit<UnitBits>,
- InputBits, OutputBits, k+OutputBits>
- ::explode1_array(out, i, x);
+ *out++ = OutValue(low_bits<OutputBits>(y));
     }
 };
-template <int UnitBits, int InputBits, int OutputBits>
-struct exploder<stream_endian::little_unit_big_bit<UnitBits>,
- InputBits, OutputBits, InputBits> {
- template <typename OutputType, typename IntputValue>
- static void explode1_array(OutputType &, unsigned &, IntputValue) {}
-};
 
-template <int UnitBits, int InputBits, int OutputBits,
- int k>
-struct exploder<stream_endian::big_unit_little_bit<UnitBits>,
- InputBits, OutputBits, k> {
- BOOST_STATIC_ASSERT(!((InputBits % UnitBits) && (UnitBits % InputBits )) &&
- !((OutputBits % UnitBits) && (UnitBits % OutputBits)));
- template <typename OutputValue, typename InputValue>
- static void step(OutputValue &z, InputValue x) {
+template <int UnitBits, int InputBits, int OutputBits, int k>
+struct exploder_step<stream_endian::big_unit_little_bit<UnitBits>,
+ InputBits, OutputBits, k> {
+ template <typename InputValue, typename OutIter>
+ static void step(InputValue const &x, OutIter &out) {
         int const kb = (k % UnitBits);
         int const ku = k - kb;
         int const shift =
             OutputBits >= UnitBits ? InputBits - (OutputBits+k) :
             InputBits >= UnitBits ? InputBits - (UnitBits+ku) + kb :
                                      kb;
+ typedef typename std::iterator_traits<OutIter>::value_type OutValue;
         InputValue y = unbounded_shr<shift>(x);
- z = OutputValue(low_bits<OutputBits>(y));
+ *out++ = OutValue(low_bits<OutputBits>(y));
     }
- template <typename OutputType, typename InputValue>
- static void explode1_array(OutputType &out, unsigned &i, InputValue x) {
- step(out[i++], x);
- exploder<stream_endian::big_unit_little_bit<UnitBits>,
- InputBits, OutputBits, k+OutputBits>
- ::explode1_array(out, i, x);
+};
+
+template <int UnitBits, int InputBits, int OutputBits, int k>
+struct exploder_step<stream_endian::little_unit_little_bit<UnitBits>,
+ InputBits, OutputBits, k> {
+ template <typename InputValue, typename OutIter>
+ static void step(InputValue const &x, OutIter &out) {
+ int const shift = k;
+ typedef typename std::iterator_traits<OutIter>::value_type OutValue;
+ InputValue y = unbounded_shr<shift>(x);
+ *out++ = OutValue(low_bits<OutputBits>(y));
     }
 };
-template <int UnitBits, int InputBits, int OutputBits>
-struct exploder<stream_endian::big_unit_little_bit<UnitBits>,
- InputBits, OutputBits, InputBits> {
- template <typename OutputType, typename IntputValue>
- static void explode1_array(OutputType &, unsigned &, IntputValue) {}
+
+template <int UnitBits, int InputBits, int OutputBits, int k>
+struct exploder_step<stream_endian::host_unit<UnitBits>,
+ InputBits, OutputBits, k> {
+ template <typename InputValue, typename OutIter>
+ static void step(InputValue const &x, OutIter &out) {
+ typedef typename std::iterator_traits<OutIter>::value_type OutValue;
+ BOOST_STATIC_ASSERT(sizeof(InputValue)*CHAR_BIT == InputBits);
+ BOOST_STATIC_ASSERT(sizeof(OutValue)*CHAR_BIT == OutputBits);
+ OutValue value;
+ std::memcpy(&value, (char*)&x + k/CHAR_BIT, OutputBits/CHAR_BIT);
+ *out++ = value;
+ }
 };
 
-template <int UnitBits, int InputBits, int OutputBits,
+template <typename Endianness,
+ int InputBits, int OutputBits,
+ int k = 0>
+struct exploder;
+
+template <template <int> class Endian, int UnitBits,
+ int InputBits, int OutputBits,
           int k>
-struct exploder<stream_endian::little_unit_little_bit<UnitBits>,
- InputBits, OutputBits, k> {
- // If this fires, you probably want stream_endian::little_bit instead
- // of little_byte_little_bit or little_octet_little_bit
- BOOST_STATIC_ASSERT(!((InputBits % UnitBits) && (UnitBits % InputBits )) &&
- !((OutputBits % UnitBits) && (UnitBits % OutputBits)));
- template <typename OutputValue, typename InputValue>
- static void step(OutputValue &z, InputValue x) {
- InputValue y = unbounded_shr<k>(x);
- z = OutputValue(low_bits<OutputBits>(y));
- }
- template <typename OutputType, typename InputValue>
- static void explode1_array(OutputType &out, unsigned &i, InputValue x) {
- step(out[i++], x);
- exploder<stream_endian::little_unit_little_bit<UnitBits>,
- InputBits, OutputBits, k+OutputBits>
- ::explode1_array(out, i, x);
- }
-};
-template <int UnitBits, int InputBits, int OutputBits>
-struct exploder<stream_endian::little_unit_little_bit<UnitBits>,
- InputBits, OutputBits, InputBits> {
- template <typename OutputType, typename IntputValue>
- static void explode1_array(OutputType &, unsigned &, IntputValue) {}
+struct exploder<Endian<UnitBits>, InputBits, OutputBits, k> {
+
+ // To keep the implementation managable, input and output sizes must
+ // be multiples or factors of the unit size.
+ // If one of these is firing, you may want a bit-only stream_endian
+ // rather than one that mentions bytes or octets.
+ BOOST_STATIC_ASSERT(!(InputBits % UnitBits && UnitBits % InputBits ));
+ BOOST_STATIC_ASSERT(!(OutputBits % UnitBits && UnitBits % OutputBits));
+
+ typedef Endian<UnitBits> Endianness;
+ typedef exploder_step<Endianness, InputBits, OutputBits, k> step_type;
+ typedef exploder<Endianness, InputBits, OutputBits, k+OutputBits> next_type;
+
+ template <typename InputValue, typename OutIter>
+ static void explode(InputValue const &x, OutIter &out) {
+ step_type::step(x, out);
+ next_type::explode(x, out);
+ }
+
+};
+template <template <int> class Endian, int UnitBits,
+ int InputBits, int OutputBits>
+struct exploder<Endian<UnitBits>, InputBits, OutputBits, InputBits> {
+ template <typename InputValue, typename OutIter>
+ static void explode(InputValue const &, OutIter &) {}
 };
 
 } // namespace detail

Modified: sandbox/hash/boost/hash/detail/imploder.hpp
==============================================================================
--- sandbox/hash/boost/hash/detail/imploder.hpp (original)
+++ sandbox/hash/boost/hash/detail/imploder.hpp 2010-05-04 17:46:48 EDT (Tue, 04 May 2010)
@@ -25,127 +25,107 @@
 
 template <typename Endianness,
           int InputBits, int OutputBits,
- int k = 0>
-struct imploder;
-
-template <int UnitBits, int InputBits, int OutputBits,
           int k>
-struct imploder<stream_endian::big_unit_big_bit<UnitBits>,
- InputBits, OutputBits, k> {
- // If this fires, you probably want stream_endian::big_bit instead
- // of big_byte_big_bit or big_octet_big_bit
- BOOST_STATIC_ASSERT(!(InputBits % UnitBits && UnitBits % InputBits ) &&
- !(OutputBits % UnitBits && UnitBits % OutputBits));
+struct imploder_step;
+
+template <int UnitBits, int InputBits, int OutputBits, int k>
+struct imploder_step<stream_endian::big_unit_big_bit<UnitBits>,
+ InputBits, OutputBits, k> {
     template <typename InputValue, typename OutputValue>
     static void step(InputValue z, OutputValue &x) {
+ int const shift = OutputBits - (InputBits+k);
         OutputValue y = low_bits<InputBits>(OutputValue(z));
- x |= unbounded_shl<OutputBits - (InputBits+k)>(y);
- }
- template <typename InputType, typename OutputValue>
- static void implode1_array(InputType const &in, unsigned &i, OutputValue &x) {
- step(in[i++], x);
- imploder<stream_endian::big_unit_big_bit<UnitBits>,
- InputBits, OutputBits, k+InputBits>
- ::implode1_array(in, i, x);
+ x |= unbounded_shl<shift>(y);
     }
 };
-template <int UnitBits, int InputBits, int OutputBits>
-struct imploder<stream_endian::big_unit_big_bit<UnitBits>,
- InputBits, OutputBits, OutputBits> {
- template <typename InputType, typename OutputValue>
- static void implode1_array(InputType const &, unsigned &, OutputValue &) {}
-};
 
-template <int UnitBits, int InputBits, int OutputBits,
- int k>
-struct imploder<stream_endian::little_unit_big_bit<UnitBits>,
- InputBits, OutputBits, k> {
- BOOST_STATIC_ASSERT(!((InputBits % UnitBits) && (UnitBits % InputBits )) &&
- !((OutputBits % UnitBits) && (UnitBits % OutputBits)));
+template <int UnitBits, int InputBits, int OutputBits, int k>
+struct imploder_step<stream_endian::little_unit_big_bit<UnitBits>,
+ InputBits, OutputBits, k> {
     template <typename InputValue, typename OutputValue>
     static void step(InputValue z, OutputValue &x) {
- OutputValue y = low_bits<InputBits>(OutputValue(z));
         int const kb = (k % UnitBits);
         int const ku = k - kb;
         int const shift =
             InputBits >= UnitBits ? k :
             OutputBits >= UnitBits ? ku + (UnitBits-(InputBits+kb)) :
                                      OutputBits - (InputBits+kb);
+ OutputValue y = low_bits<InputBits>(OutputValue(z));
         x |= unbounded_shl<shift>(y);
     }
- template <typename InputType, typename OutputValue>
- static void implode1_array(InputType const &in, unsigned &i, OutputValue &x) {
- step(in[i++], x);
- imploder<stream_endian::little_unit_big_bit<UnitBits>,
- InputBits, OutputBits, k+InputBits>
- ::implode1_array(in, i, x);
- }
-};
-template <int UnitBits, int InputBits, int OutputBits>
-struct imploder<stream_endian::little_unit_big_bit<UnitBits>,
- InputBits, OutputBits, OutputBits> {
- template <typename InputType, typename OutputValue>
- static void implode1_array(InputType const &, unsigned &, OutputValue &) {}
 };
 
-template <int UnitBits, int InputBits, int OutputBits,
- int k>
-struct imploder<stream_endian::big_unit_little_bit<UnitBits>,
- InputBits, OutputBits, k> {
- BOOST_STATIC_ASSERT(!((InputBits % UnitBits) && (UnitBits % InputBits )) &&
- !((OutputBits % UnitBits) && (UnitBits % OutputBits)));
+template <int UnitBits, int InputBits, int OutputBits, int k>
+struct imploder_step<stream_endian::big_unit_little_bit<UnitBits>,
+ InputBits, OutputBits, k> {
     template <typename InputValue, typename OutputValue>
     static void step(InputValue z, OutputValue &x) {
- OutputValue y = low_bits<InputBits>(OutputValue(z));
         int const kb = (k % UnitBits);
         int const ku = k - kb;
         int const shift =
             InputBits >= UnitBits ? OutputBits - (InputBits+k) :
             OutputBits >= UnitBits ? OutputBits - (UnitBits+ku) + kb :
                                      kb;
+ OutputValue y = low_bits<InputBits>(OutputValue(z));
         x |= unbounded_shl<shift>(y);
     }
- template <typename InputType, typename OutputValue>
- static void implode1_array(InputType const &in, unsigned &i, OutputValue &x) {
- step(in[i++], x);
- imploder<stream_endian::big_unit_little_bit<UnitBits>,
- InputBits, OutputBits, k+InputBits>
- ::implode1_array(in, i, x);
- }
-};
-template <int UnitBits, int InputBits, int OutputBits>
-struct imploder<stream_endian::big_unit_little_bit<UnitBits>,
- InputBits, OutputBits, OutputBits> {
- template <typename InputType, typename OutputValue>
- static void implode1_array(InputType const &, unsigned &, OutputValue &) {}
 };
 
-template <int UnitBits, int InputBits, int OutputBits,
- int k>
-struct imploder<stream_endian::little_unit_little_bit<UnitBits>,
- InputBits, OutputBits, k> {
- // If this fires, you probably want stream_endian::little_bit instead
- // of little_byte_little_bit or little_octet_little_bit
- BOOST_STATIC_ASSERT(!((InputBits % UnitBits) && (UnitBits % InputBits )) &&
- !((OutputBits % UnitBits) && (UnitBits % OutputBits)));
+template <int UnitBits, int InputBits, int OutputBits, int k>
+struct imploder_step<stream_endian::little_unit_little_bit<UnitBits>,
+ InputBits, OutputBits, k> {
     template <typename InputValue, typename OutputValue>
     static void step(InputValue z, OutputValue &x) {
+ int const shift = k;
         OutputValue y = low_bits<InputBits>(OutputValue(z));
- x |= unbounded_shl<k>(y);
+ x |= unbounded_shl<shift>(y);
     }
- template <typename InputType, typename OutputValue>
- static void implode1_array(InputType const &in, unsigned &i, OutputValue &x) {
- step(in[i++], x);
- imploder<stream_endian::little_unit_little_bit<UnitBits>,
- InputBits, OutputBits, k+InputBits>
- ::implode1_array(in, i, x);
+};
+
+template <int UnitBits, int InputBits, int OutputBits, int k>
+struct imploder_step<stream_endian::host_unit<UnitBits>,
+ InputBits, OutputBits, k> {
+ template <typename InputValue, typename OutputValue>
+ static void step(InputValue z, OutputValue &x) {
+ BOOST_STATIC_ASSERT(sizeof(InputValue)*CHAR_BIT == InputBits);
+ BOOST_STATIC_ASSERT(sizeof(OutputValue)*CHAR_BIT == OutputBits);
+ std::memcpy((char*)&x + k/CHAR_BIT, &z, InputBits/CHAR_BIT);
     }
 };
-template <int UnitBits, int InputBits, int OutputBits>
-struct imploder<stream_endian::little_unit_little_bit<UnitBits>,
- InputBits, OutputBits, OutputBits> {
- template <typename InputType, typename OutputValue>
- static void implode1_array(InputType const &, unsigned &, OutputValue &) {}
+
+template <typename Endianness,
+ int InputBits, int OutputBits,
+ int k = 0>
+struct imploder;
+
+template <template <int> class Endian, int UnitBits,
+ int InputBits, int OutputBits,
+ int k>
+struct imploder<Endian<UnitBits>, InputBits, OutputBits, k> {
+
+ // To keep the implementation managable, input and output sizes must
+ // be multiples or factors of the unit size.
+ // If one of these is firing, you may want a bit-only stream_endian
+ // rather than one that mentions bytes or octets.
+ BOOST_STATIC_ASSERT(!(InputBits % UnitBits && UnitBits % InputBits ));
+ BOOST_STATIC_ASSERT(!(OutputBits % UnitBits && UnitBits % OutputBits));
+
+ typedef Endian<UnitBits> Endianness;
+ typedef imploder_step<Endianness, InputBits, OutputBits, k> step_type;
+ typedef imploder<Endianness, InputBits, OutputBits, k+InputBits> next_type;
+
+ template <typename InIter, typename OutputValue>
+ static void implode(InIter &in, OutputValue &x) {
+ step_type::step(*in++, x);
+ next_type::implode(in, x);
+ }
+
+};
+template <template <int> class Endian, int UnitBits,
+ int InputBits, int OutputBits>
+struct imploder<Endian<UnitBits>, InputBits, OutputBits, OutputBits> {
+ template <typename InIter, typename OutputValue>
+ static void implode(InIter &, OutputValue &) {}
 };
 
 } // namespace detail

Modified: sandbox/hash/boost/hash/pack.hpp
==============================================================================
--- sandbox/hash/boost/hash/pack.hpp (original)
+++ sandbox/hash/boost/hash/pack.hpp 2010-05-04 17:46:48 EDT (Tue, 04 May 2010)
@@ -58,13 +58,25 @@
 
     BOOST_STATIC_ASSERT(InputBits % OutputBits == 0);
 
- template <typename InputType, typename OutputType>
- static void pack_n(InputType const *in, size_t in_n,
- OutputType *out) {
- unsigned i = 0;
+ template <typename InIter, typename OutIter>
+ static void pack_n(InIter in, size_t in_n,
+ OutIter out) {
         for (unsigned j = 0; j < in_n; ++j) {
+ typedef typename std::iterator_traits<InIter>::value_type InValue;
+ InValue const value = *in++;
             detail::exploder<Endianness, InputBits, OutputBits>
- ::explode1_array(out, i, in[j]);
+ ::explode(value, out);
+ }
+ }
+
+ template <typename InIter, typename OutIter>
+ static void pack(InIter in, InIter in_e,
+ OutIter out) {
+ while (in != in_e) {
+ typedef typename std::iterator_traits<InIter>::value_type InValue;
+ InValue const value = *in++;
+ detail::exploder<Endianness, InputBits, OutputBits>
+ ::explode(value, out);
         }
     }
 
@@ -78,101 +90,38 @@
 
     BOOST_STATIC_ASSERT(OutputBits % InputBits == 0);
 
- template <typename InputType, typename OutputType>
- static void pack_n(InputType const *in, size_t in_n,
- OutputType *out) {
+ template <typename InIter, typename OutIter>
+ static void pack_n(InIter in, size_t in_n,
+ OutIter out) {
         size_t out_n = in_n/(OutputBits/InputBits);
- unsigned i = 0;
         for (unsigned j = 0; j < out_n; ++j) {
+ typedef typename std::iterator_traits<OutIter>::value_type OutValue;
+ OutValue value = OutValue();
             detail::imploder<Endianness, InputBits, OutputBits>
- ::implode1_array(in, i, out[j] = 0);
+ ::implode(in, value);
+ *out++ = value;
         }
     }
 
-};
-
-template <int UnitBits, int InputBits, int OutputBits>
-struct real_packer<stream_endian::host_unit<UnitBits>,
- InputBits, OutputBits,
- true, true> {
-
- BOOST_STATIC_ASSERT(!(InputBits % UnitBits) &&
- !(OutputBits % UnitBits));
-
- template <typename InputType, typename OutputType>
- static void pack_n(InputType const *in, size_t in_n,
- OutputType *out) {
- // FIXME: Bad assumption
- BOOST_ASSERT(sizeof(InputType)*OutputBits ==
- sizeof(OutputType)*InputBits);
- std::memcpy(&out[0], &in[0], InputBits*in_n/CHAR_BIT);
+ template <typename InIter, typename OutIter>
+ static void pack(InIter in, InIter in_e,
+ OutIter out) {
+ while (in != in_e) {
+ typedef typename std::iterator_traits<OutIter>::value_type OutValue;
+ OutValue value = OutValue();
+ detail::imploder<Endianness, InputBits, OutputBits>
+ ::implode(in, value);
+ *out++ = value;
+ }
     }
 
 };
-template <int UnitBits, int InputBits, int OutputBits>
-struct real_packer<stream_endian::host_unit<UnitBits>,
- InputBits, OutputBits,
- false, true>
- : real_packer<stream_endian::host_unit<UnitBits>,
- InputBits, OutputBits,
- true, true> {};
-template <int UnitBits, int InputBits, int OutputBits>
-struct real_packer<stream_endian::host_unit<UnitBits>,
- InputBits, OutputBits,
- true, false>
- : real_packer<stream_endian::host_unit<UnitBits>,
- InputBits, OutputBits,
- true, true> {};
 
 template <typename Endianness,
           int InputBits, int OutputBits,
           bool BytesOnly = !(InputBits % CHAR_BIT) && !(OutputBits % CHAR_BIT)>
 struct packer : real_packer<Endianness, InputBits, OutputBits> {};
 
-#ifndef BOOST_HASH_NO_OPTIMIZATION
-
-// When inputs and outputs are multiples of bytes
-// and the requested endian matches that of the host,
-// use the non-portable -- and hopefully-faster -- implementation instead
-
-#ifdef BOOST_LITTLE_ENDIAN
-template <int InputBits, int OutputBits>
-struct packer<stream_endian::little_bit,
- InputBits, OutputBits, true>
- : real_packer<stream_endian::host_byte,
- InputBits, OutputBits> {};
-template <int InputBits, int OutputBits>
-struct packer<stream_endian::little_byte_big_bit,
- InputBits, OutputBits, true>
- : real_packer<stream_endian::host_byte,
- InputBits, OutputBits> {};
-template <int InputBits, int OutputBits>
-struct packer<stream_endian::little_byte_little_bit,
- InputBits, OutputBits, true>
- : real_packer<stream_endian::host_byte,
- InputBits, OutputBits> {};
-#endif
-
-#ifdef BOOST_BIG_ENDIAN
-template <int InputBits, int OutputBits>
-struct packer<stream_endian::big_bit,
- InputBits, OutputBits, true>
- : real_packer<stream_endian::host_byte,
- InputBits, OutputBits> {};
-template <int InputBits, int OutputBits>
-struct packer<stream_endian::big_byte_big_bit,
- InputBits, OutputBits, true>
- : real_packer<stream_endian::host_byte,
- InputBits, OutputBits> {};
-template <int InputBits, int OutputBits>
-struct packer<stream_endian::big_byte_little_bit,
- InputBits, OutputBits, true>
- : real_packer<stream_endian::host_byte,
- InputBits, OutputBits> {};
-#endif
-
-#endif
-
 template <typename Endianness,
           int InValueBits, int OutValueBits,
           typename IterT1, typename IterT2>

Modified: sandbox/hash/boost/hash/stream_preprocessor.hpp
==============================================================================
--- sandbox/hash/boost/hash/stream_preprocessor.hpp (original)
+++ sandbox/hash/boost/hash/stream_preprocessor.hpp 2010-05-04 17:46:48 EDT (Tue, 04 May 2010)
@@ -173,7 +173,7 @@
         update_one(padding_values[0]);
 #else
         value_type pad = 0;
- detail::imploder<endian, 1, value_bits>::step(1, pad);
+ detail::imploder_step<endian, 1, value_bits, 0>::step(1, pad);
         update_one(pad);
 #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