--- boost_1_57_0/boost/dynamic_bitset/dynamic_bitset.hpp 2014-06-25 21:27:29.000000000 +0200 +++ boost_1_57_0.patched/boost/dynamic_bitset/dynamic_bitset.hpp 2015-01-27 16:13:40.251831531 +0100 @@ -1427,10 +1427,8 @@ // ships with gcc 2.95 has an exceptions() member function but // nothing is actually implemented; not even the class ios::failure. - using namespace std; - - const ios::iostate ok = ios::goodbit; - ios::iostate err = ok; + const std::ios::iostate ok = std::ios::goodbit; + std::ios::iostate err = ok; if (os.opfx()) { @@ -1443,13 +1441,13 @@ || (bitsetsize_type) os.width() <= sz? 0 : os.width() - sz; const char fill_char = os.fill(); - const ios::fmtflags adjustfield = os.flags() & ios::adjustfield; + const std::ios::fmtflags adjustfield = os.flags() & std::ios::adjustfield; // if needed fill at left; pad is decresed along the way - if (adjustfield != ios::left) { + if (std::ios::adjustfield != std::ios::left) { for (; 0 < npad; --npad) if (fill_char != buf->sputc(fill_char)) { - err |= ios::failbit; + err |= std::ios::failbit; break; } } @@ -1459,7 +1457,7 @@ for (bitsetsize_type i = b.size(); 0 < i; --i) { const char dig = b.test(i-1)? '1' : '0'; if (EOF == buf->sputc(dig)) { - err |= ios::failbit; + err |= std::ios::failbit; break; } } @@ -1469,7 +1467,7 @@ // if needed fill at right for (; 0 < npad; --npad) { if (fill_char != buf->sputc(fill_char)) { - err |= ios::failbit; + err |= std::ios::failbit; break; } } @@ -1493,12 +1491,10 @@ const dynamic_bitset& b) { - using namespace std; - - const ios_base::iostate ok = ios_base::goodbit; - ios_base::iostate err = ok; + const std::ios_base::iostate ok = std::ios_base::goodbit; + std::ios_base::iostate err = ok; - typename basic_ostream::sentry cerberos(os); + typename std::basic_ostream::sentry cerberos(os); if (cerberos) { BOOST_DYNAMIC_BITSET_CTYPE_FACET(Ch, fac, os.getloc()); @@ -1508,21 +1504,21 @@ BOOST_TRY { typedef typename dynamic_bitset::size_type bitset_size_type; - typedef basic_streambuf buffer_type; + typedef std::basic_streambuf buffer_type; buffer_type * buf = os.rdbuf(); // careful: os.width() is signed (and can be < 0) const bitset_size_type width = (os.width() <= 0) ? 0 : static_cast(os.width()); - streamsize npad = (width <= b.size()) ? 0 : width - b.size(); + std::streamsize npad = (width <= b.size()) ? 0 : width - b.size(); const Ch fill_char = os.fill(); - const ios_base::fmtflags adjustfield = os.flags() & ios_base::adjustfield; + const std::ios_base::fmtflags adjustfield = os.flags() & std::ios_base::adjustfield; // if needed fill at left; pad is decreased along the way - if (adjustfield != ios_base::left) { + if (adjustfield != std::ios_base::left) { for (; 0 < npad; --npad) if (Tr::eq_int_type(Tr::eof(), buf->sputc(fill_char))) { - err |= ios_base::failbit; + err |= std::ios_base::failbit; break; } } @@ -1533,7 +1529,7 @@ typename buffer_type::int_type ret = buf->sputc(b.test(i-1)? one : zero); if (Tr::eq_int_type(Tr::eof(), ret)) { - err |= ios_base::failbit; + err |= std::ios_base::failbit; break; } } @@ -1543,7 +1539,7 @@ // if needed fill at right for (; 0 < npad; --npad) { if (Tr::eq_int_type(Tr::eof(), buf->sputc(fill_char))) { - err |= ios_base::failbit; + err |= std::ios_base::failbit; break; } } @@ -1554,7 +1550,7 @@ } BOOST_CATCH (...) { // see std 27.6.1.1/4 bool rethrow = false; - BOOST_TRY { os.setstate(ios_base::failbit); } BOOST_CATCH (...) { rethrow = true; } BOOST_CATCH_END + BOOST_TRY { os.setstate(std::ios_base::failbit); } BOOST_CATCH (...) { rethrow = true; } BOOST_CATCH_END if (rethrow) BOOST_RETHROW; @@ -1647,17 +1643,15 @@ operator>>(std::basic_istream& is, dynamic_bitset& b) { - using namespace std; - typedef dynamic_bitset bitset_type; typedef typename bitset_type::size_type size_type; - const streamsize w = is.width(); + const std::streamsize w = is.width(); const size_type limit = 0 < w && static_cast(w) < b.max_size()? static_cast(w) : b.max_size(); - ios_base::iostate err = ios_base::goodbit; - typename basic_istream::sentry cerberos(is); // skips whitespaces + std::ios_base::iostate err = std::ios_base::goodbit; + typename std::basic_istream::sentry cerberos(is); // skips whitespaces if(cerberos) { // in accordance with prop. resol. of lib DR 303 [last checked 4 Feb 2004] @@ -1668,12 +1662,12 @@ b.clear(); BOOST_TRY { typename bitset_type::bit_appender appender(b); - basic_streambuf * buf = is.rdbuf(); + std::basic_streambuf * buf = is.rdbuf(); 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; + err |= std::ios_base::eofbit; break; } else { @@ -1697,7 +1691,7 @@ // append to the underlying vector (out of memory) bool rethrow = false; // see std 27.6.1.1/4 - BOOST_TRY { is.setstate(ios_base::badbit); } + BOOST_TRY { is.setstate(std::ios_base::badbit); } BOOST_CATCH(...) { rethrow = true; } BOOST_CATCH_END @@ -1710,8 +1704,8 @@ is.width(0); if (b.size() == 0 /*|| !cerberos*/) - err |= ios_base::failbit; - if (err != ios_base::goodbit) + err |= std::ios_base::failbit; + if (err != std::ios_base::goodbit) is.setstate (err); // may throw return is;