From 07b5b85dfedbfe1bfd8ac7a7ff885575689c4671 Mon Sep 17 00:00:00 2001 From: Gennaro Prota Date: Sun, 13 Aug 2006 15:08:24 +0000 Subject: [PATCH] some cleanup (beware: not compiled) [SVN r34883] --- bitset_test.hpp | 40 ++--- dyn_bitset_unit_tests1.cpp | 2 +- dyn_bitset_unit_tests3.cpp | 2 +- dyn_bitset_unit_tests4.cpp | 4 +- dynamic_bitset.html | 48 +---- include/boost/detail/dynamic_bitset.hpp | 1 - include/boost/dynamic_bitset/config.hpp | 2 +- .../boost/dynamic_bitset/dynamic_bitset.hpp | 170 +++++------------- 8 files changed, 70 insertions(+), 199 deletions(-) diff --git a/bitset_test.hpp b/bitset_test.hpp index 08abc22..90e6380 100644 --- a/bitset_test.hpp +++ b/bitset_test.hpp @@ -18,7 +18,7 @@ #endif #include -#include // used for operator<< :( - gps +#include // used for operator<< #include // for (basic_string and) getline() #include // for std::min #include // is sometimes macro-guarded :-( @@ -79,7 +79,7 @@ bool is_white_space(const Stream & /*s*/, char c) } #else template -bool is_one_or_zero(const Stream& s, Ch c) // gps +bool is_one_or_zero(const Stream& s, Ch c) { typedef typename Stream::traits_type Tr; const Ch zero = s.widen('0'); @@ -92,7 +92,7 @@ bool is_white_space(const Stream & s, Ch c) { // NOTE: the using directive is to satisfy Borland 5.6.4 // with its own library (STLport), which doesn't - // like std::isspace(c, loc) - gps + // like std::isspace(c, loc) using namespace std; return isspace(c, s.getloc()); } @@ -156,7 +156,7 @@ struct bitset_test { std::size_t num_bits = (std::size_t)(-1)) { - std::size_t rlen = (std::min)(max_char, str.size() - pos); // [gps] + std::size_t rlen = (std::min)(max_char, str.size() - pos); // The resulting size N of the bitset is num_bits, if // that is different from the default arg, rlen otherwise. @@ -175,7 +175,7 @@ struct bitset_test { std::size_t m = (std::min)(num_bits, rlen); std::size_t j; for (j = 0; j < m; ++j) - BOOST_CHECK(b[j] == (str[pos + m - 1 - j] == '1')); // [gps] + BOOST_CHECK(b[j] == (str[pos + m - 1 - j] == '1')); // If M < N, remaining bit positions are zero for (; j < actual_size; ++j) BOOST_CHECK(b[j] == 0); @@ -211,7 +211,7 @@ struct bitset_test { } } - // gps - TODO from_block_range (below) should be splitted + // TODO from_block_range (below) should be splitted // PRE: std::equal(first1, last1, first2) == true static void from_block_range(const std::vector& blocks) @@ -239,7 +239,7 @@ struct bitset_test { BOOST_CHECK(bset[bit] == nth_bit(blocks[b], i)); } } - BOOST_CHECK(n <= bset.num_blocks()); // gps - ok? ask on the list + BOOST_CHECK(n <= bset.num_blocks()); } } @@ -349,7 +349,7 @@ struct bitset_test { static void append_block(const Bitset& lhs) { Bitset b(lhs); - Block value(128); // gps + Block value(128); b.append(value); BOOST_CHECK(b.size() == lhs.size() + bits_per_block); for (typename Bitset::block_width_type i = 0; i < bits_per_block; ++i) @@ -649,7 +649,7 @@ struct bitset_test { BOOST_CHECK(num == 0); else { for (std::size_t i = 0; i < sz; ++i) - BOOST_CHECK(lhs[i] == (i < n ? nth_bit(num, i) : 0)); //G.P.S. bugfix + BOOST_CHECK(lhs[i] == (i < n ? nth_bit(num, i) : 0)); } } } @@ -1020,14 +1020,14 @@ struct bitset_test { } #endif - BOOST_CHECK(did_throw || !stream_was_good || (s.width() == 0)); // gps + BOOST_CHECK(did_throw || !stream_was_good || (s.width() == 0)); - if (!stream_was_good) { // gps + if (!stream_was_good) { BOOST_CHECK(s.good() == false); // this should actually be oldstate == s.rdstate() // but some implementations add badbit in the - // sentry constructor - gps + // sentry constructor // BOOST_CHECK((oldstate & s.rdstate()) == oldstate); BOOST_CHECK(s.width() == w); @@ -1039,7 +1039,7 @@ struct bitset_test { // Of course dynamic_bitset's operator << doesn't require that. size_type total_len = w <= 0 || (size_type)(w) < b.size()? b.size() : w; - const string_type padding (total_len - b.size(), fill_char); // gps + const string_type padding (total_len - b.size(), fill_char); string_type expected; boost::to_string(b, expected); if ((s.flags() & std::ios::adjustfield) != std::ios::left) @@ -1053,7 +1053,7 @@ struct bitset_test { s.close(); corresponding_input_stream_type is(file_name); string_type contents; - std::getline(is, contents, char_type()); // gps + std::getline(is, contents, char_type()); BOOST_CHECK(contents == expected); } } @@ -1084,7 +1084,7 @@ struct bitset_test { } catch(const std::ios::failure &) { did_throw = true; - }// catch bad alloc?? - gps + } // postconditions BOOST_CHECK(except == is.exceptions()); // paranoid @@ -1140,7 +1140,7 @@ struct bitset_test { // eofbit if((after_digits == len && max_digits > num_digits )) - BOOST_CHECK(has_flags(is, std::ios::eofbit)); // gps + BOOST_CHECK(has_flags(is, std::ios::eofbit)); else BOOST_CHECK(!has_flags(is, std::ios::eofbit)); @@ -1183,16 +1183,16 @@ struct bitset_test { // bitset though there's nothing in the file to be extracted. // Note that the dynamic_bitset docs say a sentry object is // constructed and then converted to bool, thus we rely on - // what the underlying library does. - gps + // what the underlying library does. // -#if !defined(BOOST_DINKUMWARE_STDLIB) || (BOOST_DINKUMWARE_STDLIB >= 306) // what about STLPORT? - gps +#if !defined(BOOST_DINKUMWARE_STDLIB) || (BOOST_DINKUMWARE_STDLIB >= 306) BOOST_CHECK(b == a_copy); #else BOOST_CHECK(b.empty() == true); #endif } else { - String sub = str.substr(after_spaces, num_digits); // gps + String sub = str.substr(after_spaces, num_digits); BOOST_CHECK(b == Bitset(sub)); } @@ -1205,7 +1205,7 @@ struct bitset_test { // clear the stream to allow further reading then // retrieve any remaining chars with a single getline() is.exceptions(std::ios::goodbit); - is.clear(); // gps + is.clear(); String remainder; std::getline(is, remainder, Ch()); if(stream_was_good) diff --git a/dyn_bitset_unit_tests1.cpp b/dyn_bitset_unit_tests1.cpp index be8ae04..0305166 100644 --- a/dyn_bitset_unit_tests1.cpp +++ b/dyn_bitset_unit_tests1.cpp @@ -101,7 +101,7 @@ void run_test_cases( BOOST_EXPLICIT_TEMPLATE_TYPE(Block) ) // one hand I should have better tests. On the other one // I don't want tests for dynamic_bitset to cope with locales, // ctype::widen, etc. (but that's what you deserve when you - // don't separate concerns at the library level) - gps + // don't separate concerns at the library level) // run_string_tests( std::wstring(L"11111000000111111111010101010101010101010111111")); diff --git a/dyn_bitset_unit_tests3.cpp b/dyn_bitset_unit_tests3.cpp index d6b72c9..32a1092 100644 --- a/dyn_bitset_unit_tests3.cpp +++ b/dyn_bitset_unit_tests3.cpp @@ -31,7 +31,7 @@ void run_test_cases( BOOST_EXPLICIT_TEMPLATE_TYPE(Block) ) // Test b.empty() { bitset_type b; - Tests::empty(b); // gps + Tests::empty(b); } { bitset_type b(1, 1ul); diff --git a/dyn_bitset_unit_tests4.cpp b/dyn_bitset_unit_tests4.cpp index 6740577..bd64eb5 100644 --- a/dyn_bitset_unit_tests4.cpp +++ b/dyn_bitset_unit_tests4.cpp @@ -134,7 +134,7 @@ void run_test_cases( BOOST_EXPLICIT_TEMPLATE_TYPE(Block) ) } { - //NOTE: there are NO string stream tests - gps + //NOTE: there are NO string stream tests } #if !defined (BOOST_DYNAMIC_BITSET_NO_WCHAR_T_TESTS) { @@ -169,7 +169,7 @@ void run_test_cases( BOOST_EXPLICIT_TEMPLATE_TYPE(Block) ) // a good "real life" test. Some characters, such as '\v' and '\f', are not // used exactly because they are the ones which will most likely give problems // on some systems (for instance '\f' could actually be written as a sequence - // of new-lines, and we could never be able to read it back) [gps] + // of new-lines, and we could never be able to read it back) // // Note how the bitset object is not initially empty. That helps checking // that it isn't erroneously clear()ed by operator>>. diff --git a/dynamic_bitset.html b/dynamic_bitset.html index fcf5849..66478d0 100644 --- a/dynamic_bitset.html +++ b/dynamic_bitset.html @@ -46,20 +46,6 @@ align="middle" width="277" height="86">

- - -

dynamic_bitset<Block, Allocator>

Contents

@@ -719,7 +705,7 @@ to std::numeric_limits<Block>::digits. dynamic_bitset::npos -The maximum value of size_type. [gps] +The maximum value of size_type.

Constructors

@@ -954,7 +940,7 @@ void Effects: This function provides the same end result as the -following code, but is typically more efficient. [gps] +following code, but is typically more efficient.
 for (; first != last; ++first)
@@ -1194,7 +1180,7 @@ object having the same type as *this. Note that if
 any dynamic_bitset operation causes size() to
 exceed max_size() then the behavior is undefined.
 

[The semantics of this function could change slightly -when lib issue 197 will be closed - G.P.S.]
+when lib issue 197 will be closed]

@@ -1205,32 +1191,6 @@ bool empty() const;
 otherwise. Note: not to be confused with none(), that has
 different semantics.
 
-
- -
 size_type count() const
@@ -1622,7 +1582,7 @@ were constructed by
 If bool(k) is true, it calls b.clear()
 then attempts to extract characters from is. For each character c
 that is a bitset digit the corresponding bit value is
-appended to the less significant end of b (appending may throw - gps ).
+appended to the less significant end of b (appending may throw).
 If is.width() is greater than zero and smaller than b.max_size()
 then the maximum number n of bits appended is is.width();
 otherwise n = b.max_size().
diff --git a/include/boost/detail/dynamic_bitset.hpp b/include/boost/detail/dynamic_bitset.hpp
index 37edb3a..8d81889 100644
--- a/include/boost/detail/dynamic_bitset.hpp
+++ b/include/boost/detail/dynamic_bitset.hpp
@@ -18,7 +18,6 @@
 #include  // for std::size_t
 #include "boost/config.hpp"
 #include "boost/detail/workaround.hpp"
-//#include "boost/static_assert.hpp" // gps
 
 
 namespace boost {
diff --git a/include/boost/dynamic_bitset/config.hpp b/include/boost/dynamic_bitset/config.hpp
index bfb8b1c..651ff33 100644
--- a/include/boost/dynamic_bitset/config.hpp
+++ b/include/boost/dynamic_bitset/config.hpp
@@ -28,7 +28,7 @@
 #define BOOST_DYNAMIC_BITSET_GNUC_VERSION  (  __GNUC__       * 100 * 100     \
                                             + __GNUC_MINOR__ * 100)
 
-// no-op function to workaround gcc bug c++/8419 - gps
+// no-op function to workaround gcc bug c++/8419
 //
 namespace boost { namespace detail {
     template  T make_non_const(T t) { return t; }
diff --git a/include/boost/dynamic_bitset/dynamic_bitset.hpp b/include/boost/dynamic_bitset/dynamic_bitset.hpp
index 6960849..dacfab7 100644
--- a/include/boost/dynamic_bitset/dynamic_bitset.hpp
+++ b/include/boost/dynamic_bitset/dynamic_bitset.hpp
@@ -68,7 +68,7 @@ public:
     typedef Block block_type;
     typedef Allocator allocator_type;
     typedef std::size_t size_type;
-    typedef int block_width_type; // gps
+    typedef int block_width_type;
 
     BOOST_STATIC_CONSTANT(block_width_type, bits_per_block = (std::numeric_limits::digits));
     BOOST_STATIC_CONSTANT(size_type, npos = static_cast(-1));
@@ -77,7 +77,6 @@ public:
 public:
 
     // A proxy class to simulate lvalues of bit type.
-    // Shouldn't it be private? [gps]
     //
     class reference
     {
@@ -264,10 +263,6 @@ public:
     size_type num_blocks() const;
     size_type max_size() const;
     bool empty() const;
-#if 0 // gps
-    void reserve(size_type n);
-    size_type capacity() const;
-#endif
 
     bool is_subset_of(const dynamic_bitset& a) const;
     bool is_proper_subset_of(const dynamic_bitset& a) const;
@@ -334,7 +329,7 @@ private:
         typedef typename std::basic_string StrT;
         typedef typename StrT::traits_type Tr;
 
-        const typename StrT::size_type rlen = (std::min)(n, s.size() - pos); // gps
+        const typename StrT::size_type rlen = (std::min)(n, s.size() - pos);
         const size_type sz = ( num_bits != npos? num_bits : rlen);
         m_bits.resize(calc_num_blocks(sz));
         m_num_bits = sz;
@@ -343,7 +338,7 @@ private:
         BOOST_DYNAMIC_BITSET_CTYPE_FACET(CharT, fac, std::locale());
         const CharT one = BOOST_DYNAMIC_BITSET_WIDEN_CHAR(fac, '1');
 
-        const size_type m = num_bits < rlen ? num_bits : rlen; // [gps]
+        const size_type m = num_bits < rlen ? num_bits : rlen;
         typename StrT::size_type i = 0;
         for( ; i < m; ++i) {
 
@@ -367,7 +362,7 @@ BOOST_DYNAMIC_BITSET_PRIVATE:
     Block&        m_highest_block();
     const Block&  m_highest_block() const;
 
-    buffer_type m_bits; // [gps] to be renamed
+    buffer_type m_bits;
     size_type   m_num_bits;
 
 
@@ -428,8 +423,7 @@ BOOST_DYNAMIC_BITSET_PRIVATE:
 //  The compiler is actually right, until core issue 454 will be settled:
 //   http://www.open-std.org/JTC1/SC22/WG21/docs/cwg_active.html#454
 //
-//  Considering the direction taken by the committee, however, it
-//  looks sensible to leave BOOST_WORKAROUND for the future (G. Prota)
+//  It's arguable whether we want to mark this with BOOST_WORKAROUND or not.
 
 
 template
@@ -510,7 +504,7 @@ void swap(dynamic_bitset& b1,
 
 template 
 void
-to_string(const dynamic_bitset& b, stringT & s); // gps
+to_string(const dynamic_bitset& b, stringT & s);
 
 template 
 void
@@ -518,15 +512,13 @@ to_block_range(const dynamic_bitset& b,
                BlockOutputIterator result);
 
 
-// gps - check docs with Jeremy
-//
 template 
 inline void
 from_block_range(BlockIterator first, BlockIterator last,
                  dynamic_bitset& result)
 {
     // PRE: distance(first, last) <= numblocks()
-    std::copy (first, last, result.m_bits.begin()); //[gps]
+    std::copy (first, last, result.m_bits.begin());
 }
 
 //=============================================================================
@@ -574,7 +566,7 @@ dynamic_bitset(size_type num_bits, unsigned long value, const Allocator& alloc)
 template 
 inline dynamic_bitset::
 dynamic_bitset(const dynamic_bitset& b)
-  : m_bits(b.m_bits), m_num_bits(b.m_num_bits)  // [gps]
+  : m_bits(b.m_bits), m_num_bits(b.m_num_bits)
 {
 
 }
@@ -598,15 +590,9 @@ template 
 dynamic_bitset& dynamic_bitset::
 operator=(const dynamic_bitset& b)
 {
-#if 0 // gps
-    dynamic_bitset tmp(b);
-    this->swap(tmp);
-    return *this;
-#else
     m_bits = b.m_bits;
     m_num_bits = b.m_num_bits;
     return *this;
-#endif
 }
 
 template 
@@ -630,7 +616,7 @@ resize(size_type num_bits, bool value) // strong guarantee
   const block_type v = value? ~Block(0) : Block(0);
 
   if (required_blocks != old_num_blocks) {
-    m_bits.resize(required_blocks, v); // s.g. (copy) [gps]
+    m_bits.resize(required_blocks, v); // s.g. (copy)
   }
 
 
@@ -646,12 +632,12 @@ resize(size_type num_bits, bool value) // strong guarantee
 
   if (value && (num_bits > m_num_bits)) {
 
-    const size_type extra_bits = count_extra_bits(); // gps
+    const size_type extra_bits = count_extra_bits();
     if (extra_bits) {
         assert(old_num_blocks >= 1 && old_num_blocks <= m_bits.size());
 
         // Set them.
-        m_bits[old_num_blocks - 1] |= (v << extra_bits); // gps
+        m_bits[old_num_blocks - 1] |= (v << extra_bits);
     }
 
   }
@@ -683,8 +669,6 @@ template 
 void dynamic_bitset::
 append(Block value) // strong guarantee
 {
-    // G.P.S. to be reviewed...
-
     const block_width_type r = count_extra_bits();
 
     if (r == 0) {
@@ -871,13 +855,6 @@ template 
 dynamic_bitset&
 dynamic_bitset::set(size_type pos, bool val)
 {
-    // [gps]
-    //
-    // Below we have no set(size_type) function to call when
-    // value == true; instead of using a helper, I think
-    // overloading set (rather than giving it a default bool
-    // argument) would be more elegant.
-
     assert(pos < m_num_bits);
 
     if (val)
@@ -978,45 +955,6 @@ dynamic_bitset::operator~() const
 }
 
 
-/*
-
-The following is the straightforward implementation of count(), which
-we leave here in a comment for documentation purposes.
-
-template 
-typename dynamic_bitset::size_type
-dynamic_bitset::count() const
-{
-    size_type sum = 0;
-    for (size_type i = 0; i != this->m_num_bits; ++i)
-        if (test(i))
-            ++sum;
-    return sum;
-}
-
-The actual algorithm uses a lookup table.
-
-
-  The basic idea of the method is to pick up X bits at a time
-  from the internal array of blocks and consider those bits as
-  the binary representation of a number N. Then, to use a table
-  of 1<= CHAR_BIT and Block has no padding bits (that would be counted
-  together with the "real ones" if we saw the array as array of bytes).
-  Otherwise we simply 'extract' X bits at a time from each Block.
-
-*/
-
-
 template 
 typename dynamic_bitset::size_type
 dynamic_bitset::count() const
@@ -1073,7 +1011,7 @@ void to_string_helper(const dynamic_bitset & b, stringT & s,
 // making me (Gennaro) realize this important separation of
 // concerns issue, as well as many things about i18n.
 //
-template  // G.P.S.
+template 
 inline void
 to_string(const dynamic_bitset& b, stringT& s)
 {
@@ -1087,7 +1025,7 @@ to_string(const dynamic_bitset& b, stringT& s)
 //
 template 
 inline void
-dump_to_string(const dynamic_bitset& b, stringT& s) // G.P.S.
+dump_to_string(const dynamic_bitset& b, stringT& s)
 {
     to_string_helper(b, s, true /* =dump_all*/);
 }
@@ -1099,7 +1037,7 @@ to_block_range(const dynamic_bitset& b,
 {
     // note how this copies *all* bits, including the
     // unused ones in the last block (which are zero)
-    std::copy(b.m_bits.begin(), b.m_bits.end(), result); // [gps]
+    std::copy(b.m_bits.begin(), b.m_bits.end(), result);
 }
 
 template 
@@ -1133,7 +1071,7 @@ to_ulong() const
   result_type result = 0;
   for (size_type i = 0; i <= last_block; ++i) {
 
-    assert((size_type)bits_per_block * i < (size_type)ulong_width); // gps
+    assert((size_type)bits_per_block * i < (size_type)ulong_width);
 
     result |= (m_bits[i] << (bits_per_block * i));
   }
@@ -1183,31 +1121,6 @@ inline bool dynamic_bitset::empty() const
   return size() == 0;
 }
 
-#if 0 // gps
-template 
-inline void dynamic_bitset::reserve(size_type n)
-{
-    assert(n <= max_size()); // PRE - G.P.S.
-    m_bits.reserve(calc_num_blocks(n));
-}
-
-template 
-typename dynamic_bitset::size_type
-dynamic_bitset::capacity() const
-{
-    // capacity is m_bits.capacity() * bits_per_block
-    // unless that one overflows
-    const size_type m = static_cast(-1);
-    const size_type q = m / bits_per_block;
-
-    const size_type c = m_bits.capacity();
-
-    return c <= q ?
-        c * bits_per_block :
-        m;
-}
-#endif
-
 template 
 bool dynamic_bitset::
 is_subset_of(const dynamic_bitset& a) const
@@ -1319,7 +1232,7 @@ bool operator==(const dynamic_bitset& a,
                 const dynamic_bitset& b)
 {
     return (a.m_num_bits == b.m_num_bits)
-           && (a.m_bits == b.m_bits); // [gps]
+           && (a.m_bits == b.m_bits);
 }
 
 template 
@@ -1391,7 +1304,7 @@ operator<<(std::ostream& os, const dynamic_bitset& b)
     const ios::iostate ok = ios::goodbit;
     ios::iostate err = ok;
 
-    if (os.opfx()) { // gps
+    if (os.opfx()) {
 
         //try
         typedef typename dynamic_bitset::size_type bitsetsize_type;
@@ -1399,7 +1312,7 @@ operator<<(std::ostream& os, const dynamic_bitset& b)
         const bitsetsize_type sz = b.size();
         std::streambuf * buf = os.rdbuf();
         size_t npad = os.width() <= 0  // careful: os.width() is signed (and can be < 0)
-            || (bitsetsize_type) os.width() <= sz? 0 : os.width() - sz; //- gps
+            || (bitsetsize_type) os.width() <= sz? 0 : os.width() - sz;
 
         const char fill_char = os.fill();
         const ios::fmtflags adjustfield = os.flags() & ios::adjustfield;
@@ -1408,16 +1321,16 @@ operator<<(std::ostream& os, const dynamic_bitset& b)
         if (adjustfield != ios::left) {
             for (; 0 < npad; --npad)
                 if (fill_char != buf->sputc(fill_char)) {
-                    err |= ios::failbit;   // gps
+                    err |= ios::failbit;
                     break;
                 }
         }
 
         if (err == ok) {
             // output the bitset
-            for (bitsetsize_type i = b.size(); 0 < i; --i) {// G.P.S.
+            for (bitsetsize_type i = b.size(); 0 < i; --i) {
                 const char dig = b.test(i-1)? '1' : '0';
-                if (EOF == buf->sputc(dig)) { // ok?? gps
+                if (EOF == buf->sputc(dig)) {
                     err |= ios::failbit;
                     break;
                 }
@@ -1440,7 +1353,7 @@ operator<<(std::ostream& os, const dynamic_bitset& b)
     } // if opfx
 
     if(err != ok)
-        os.setstate(err); // assume this does NOT throw - gps
+        os.setstate(err); // assume this does NOT throw
     return os;
 
 }
@@ -1467,11 +1380,11 @@ operator<<(std::basic_ostream& os,
         try {
 
             typedef typename dynamic_bitset::size_type bitsetsize_type;
-            typedef basic_streambuf buffer_type; // G.P.S.
+            typedef basic_streambuf buffer_type;
 
             buffer_type * buf = os.rdbuf();
             size_t npad = os.width() <= 0  // careful: os.width() is signed (and can be < 0)
-                || (bitsetsize_type) os.width() <= b.size()? 0 : os.width() - b.size(); //- G.P.S.
+                || (bitsetsize_type) os.width() <= b.size()? 0 : os.width() - b.size();
 
             const Ch fill_char = os.fill();
             const ios_base::fmtflags adjustfield = os.flags() & ios_base::adjustfield;
@@ -1480,14 +1393,14 @@ operator<<(std::basic_ostream& os,
             if (adjustfield != ios_base::left) {
                 for (; 0 < npad; --npad)
                     if (Tr::eq_int_type(Tr::eof(), buf->sputc(fill_char))) {
-                          err |= ios_base::failbit;   // G.P.S.
+                          err |= ios_base::failbit;
                           break;
                     }
             }
 
             if (err == ok) {
                 // output the bitset
-                for (bitsetsize_type i = b.size(); 0 < i; --i) {// G.P.S.
+                for (bitsetsize_type i = b.size(); 0 < i; --i) {
                     typename buffer_type::int_type
                         ret = buf->sputc(b.test(i-1)? one : zero);
                     if (Tr::eq_int_type(Tr::eof(), ret)) {
@@ -1529,8 +1442,8 @@ operator<<(std::basic_ostream& os,
 
 #ifdef BOOST_OLD_IOSTREAMS
 
-    // gps - A sentry-like class that calls isfx in its
-    // destructor. Necessary because bit_appender::do_append may throw.
+    // A sentry-like class that calls isfx in its destructor.
+    // "Necessary" because bit_appender::do_append may throw.
     class pseudo_sentry {
         std::istream & m_r;
         const bool m_ok;
@@ -1554,21 +1467,21 @@ operator>>(std::istream& is, dynamic_bitset& b)
     typedef dynamic_bitset bitset_type;
     typedef typename bitset_type::size_type size_type;
 
-    std::ios::iostate err = std::ios::goodbit; // gps
+    std::ios::iostate err = std::ios::goodbit;
     pseudo_sentry cerberos(is); // skips whitespaces
     if(cerberos) {
 
         b.clear();
 
         const std::streamsize w = is.width();
-        const size_type limit = w > 0 && static_cast(w) < b.max_size()// gps
+        const size_type limit = w > 0 && static_cast(w) < b.max_size()
                                                          ? w : b.max_size();
         typename bitset_type::bit_appender appender(b);
         std::streambuf * buf = is.rdbuf();
         for(int c = buf->sgetc(); appender.get_count() < limit; c = buf->snextc() ) {
 
             if (c == EOF) {
-                err |= std::ios::eofbit; // G.P.S.
+                err |= std::ios::eofbit;
                 break;
             }
             else if (char(c) != '0' && char(c) != '1')
@@ -1576,7 +1489,6 @@ operator>>(std::istream& is, dynamic_bitset& b)
 
             else {
                 try {
-                    //throw std::bad_alloc(); // gps
                     appender.do_append(char(c) == '1');
                 }
                 catch(...) {
@@ -1588,10 +1500,10 @@ operator>>(std::istream& is, dynamic_bitset& b)
         } // for
     }
 
-    is.width(0); // gps
+    is.width(0);
     if (b.size() == 0)
         err |= std::ios::failbit;
-    if (err != std::ios::goodbit) // gps
+    if (err != std::ios::goodbit)
         is.setstate (err); // may throw
 
     return is;
@@ -1610,10 +1522,10 @@ operator>>(std::basic_istream& is, dynamic_bitset& b)
     typedef typename bitset_type::size_type size_type;
 
     const streamsize w = is.width();
-    const size_type limit = 0 < w && static_cast(w) < b.max_size()? // gps
+    const size_type limit = 0 < w && static_cast(w) < b.max_size()?
                                          w : b.max_size();
 
-    ios_base::iostate err = ios_base::goodbit; // gps
+    ios_base::iostate err = ios_base::goodbit;
     typename basic_istream::sentry cerberos(is); // skips whitespaces
     if(cerberos) {
 
@@ -1626,11 +1538,11 @@ operator>>(std::basic_istream& is, dynamic_bitset& b)
         try {
             typename bitset_type::bit_appender appender(b);
             basic_streambuf  * buf = is.rdbuf();
-            typename Tr::int_type c = buf->sgetc(); // G.P.S.
+            typename Tr::int_type c = buf->sgetc();
             for( ; appender.get_count() < limit; c = buf->snextc() ) {
 
                 if (Tr::eq_int_type(Tr::eof(), c)) {
-                    err |= ios_base::eofbit; // G.P.S.
+                    err |= ios_base::eofbit;
                     break;
                 }
                 else {
@@ -1651,7 +1563,7 @@ operator>>(std::basic_istream& is, dynamic_bitset& b)
             //
             // bits_stored bits have been extracted and stored, and
             // either no further character is extractable or we can't
-            // append to the underlying vector (out of memory) gps
+            // append to the underlying vector (out of memory)
 
             bool rethrow = false;   // see std 27.6.1.1/4
             try { is.setstate(ios_base::badbit); }
@@ -1663,10 +1575,10 @@ operator>>(std::basic_istream& is, dynamic_bitset& b)
         }
     }
 
-    is.width(0); // gps
+    is.width(0);
     if (b.size() == 0 /*|| !cerberos*/)
         err |= ios_base::failbit;
-    if (err != ios_base::goodbit) // gps
+    if (err != ios_base::goodbit)
         is.setstate (err); // may throw
 
     return is;
@@ -1724,7 +1636,7 @@ inline void
 swap(dynamic_bitset& left,
      dynamic_bitset& right) // no throw
 {
-    left.swap(right); // gps
+    left.swap(right);
 }