Index: boost/rational.hpp =================================================================== --- boost/rational.hpp (Revision 79827) +++ boost/rational.hpp (Arbeitskopie) @@ -525,28 +525,30 @@ // A utility class to reset the format flags for an istream at end // of scope, even in case of exceptions + template struct resetter { - resetter(std::istream& is) : is_(is), f_(is.flags()) {} + resetter(std::basic_istream& is) : is_(is), f_(is.flags()) {} ~resetter() { is_.flags(f_); } - std::istream& is_; - std::istream::fmtflags f_; // old GNU c++ lib has no ios_base + std::basic_istream& is_; + typename std::basic_istream::fmtflags f_; // old GNU c++ lib has no ios_base }; } // Input and output -template -std::istream& operator>> (std::istream& is, rational& r) +template +std::basic_istream& operator>> (std::basic_istream& is, + rational& r) { IntType n = IntType(0), d = IntType(1); - char c = 0; - detail::resetter sentry(is); + CharType c = 0; + detail::resetter sentry(is); is >> n; c = is.get(); - if (c != '/') - is.clear(std::istream::badbit); // old GNU c++ lib has no ios_base + if (c != static_cast('/')) + is.clear(std::basic_istream::badbit); // old GNU c++ lib has no ios_base #if !defined(__GNUC__) || (defined(__GNUC__) && (__GNUC__ >= 3)) || defined __SGI_STL_PORT is >> std::noskipws; @@ -562,10 +564,11 @@ } // Add manipulators for output format? -template -std::ostream& operator<< (std::ostream& os, const rational& r) +template +std::basic_ostream& operator<< (std::basic_ostream& os, + const rational& r) { - os << r.numerator() << '/' << r.denominator(); + os << r.numerator() << static_cast('/') << r.denominator(); return os; }