diff options
author | DongHun Kwak <dh0128.kwak@samsung.com> | 2016-10-06 10:41:18 +0900 |
---|---|---|
committer | DongHun Kwak <dh0128.kwak@samsung.com> | 2016-10-06 10:43:11 +0900 |
commit | f763a99a501650eff2c60288aa6f10ef916d769e (patch) | |
tree | 02af7e13f9a38c888ebf340fe764cbe7dae99da9 /boost/rational.hpp | |
parent | 5cde13f21d36c7224b0e13d11c4b49379ae5210d (diff) | |
download | boost-f763a99a501650eff2c60288aa6f10ef916d769e.tar.gz boost-f763a99a501650eff2c60288aa6f10ef916d769e.tar.bz2 boost-f763a99a501650eff2c60288aa6f10ef916d769e.zip |
Imported Upstream version 1.62.0upstream/1.62.0
Change-Id: I9d4c1ddb7b7d8f0069217ecc582700f9fda6dd4c
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
Diffstat (limited to 'boost/rational.hpp')
-rw-r--r-- | boost/rational.hpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/boost/rational.hpp b/boost/rational.hpp index 72d11e7d06..2b74b05fd3 100644 --- a/boost/rational.hpp +++ b/boost/rational.hpp @@ -630,26 +630,25 @@ std::istream& operator>> (std::istream& is, rational<IntType>& r) template <typename IntType> std::ostream& operator<< (std::ostream& os, const rational<IntType>& r) { - using namespace std; - // The slash directly precedes the denominator, which has no prefixes. - ostringstream ss; + std::ostringstream ss; ss.copyfmt( os ); ss.tie( NULL ); - ss.exceptions( ios::goodbit ); + ss.exceptions( std::ios::goodbit ); ss.width( 0 ); - ss << noshowpos << noshowbase << '/' << r.denominator(); + ss << std::noshowpos << std::noshowbase << '/' << r.denominator(); // The numerator holds the showpos, internal, and showbase flags. - string const tail = ss.str(); - streamsize const w = os.width() - static_cast<streamsize>( tail.size() ); + std::string const tail = ss.str(); + std::streamsize const w = + os.width() - static_cast<std::streamsize>( tail.size() ); ss.clear(); ss.str( "" ); ss.flags( os.flags() ); - ss << setw( w < 0 || (os.flags() & ios::adjustfield) != ios::internal ? 0 : - w ) << r.numerator(); + ss << std::setw( w < 0 || (os.flags() & std::ios::adjustfield) != + std::ios::internal ? 0 : w ) << r.numerator(); return os << ss.str() + tail; } #endif // BOOST_NO_IOSTREAM @@ -706,4 +705,3 @@ struct lcm_evaluator< rational<IntType> > } // namespace boost #endif // BOOST_RATIONAL_HPP - |