Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r77716 - trunk/boost
From: antoshkka_at_[hidden]
Date: 2012-04-02 11:33:46


Author: apolukhin
Date: 2012-04-02 11:33:46 EDT (Mon, 02 Apr 2012)
New Revision: 77716
URL: http://svn.boost.org/trac/boost/changeset/77716

Log:
Fixes #6717 (now also setting precision for float types conversion when using iostreams)
Text files modified:
   trunk/boost/lexical_cast.hpp | 6 ++++--
   1 files changed, 4 insertions(+), 2 deletions(-)

Modified: trunk/boost/lexical_cast.hpp
==============================================================================
--- trunk/boost/lexical_cast.hpp (original)
+++ trunk/boost/lexical_cast.hpp 2012-04-02 11:33:46 EDT (Mon, 02 Apr 2012)
@@ -1254,7 +1254,7 @@
             {
 #if defined(BOOST_NO_STRINGSTREAM) || defined(BOOST_NO_STD_LOCALE)
                 // If you have compilation error at this point, than your STL library
- // unsupports such conversions. Try updating it.
+ // does not support such conversions. Try updating it.
                 BOOST_STATIC_ASSERT((boost::is_same<char, CharT>::value));
 #endif
                 bool const result = !(out_stream << input).fail();
@@ -1279,8 +1279,10 @@
             }
 
             template <class T, class SomeCharT>
- bool shl_real_type(const T& val, SomeCharT*, SomeCharT*)
+ bool shl_real_type(const T& val, SomeCharT* begin, SomeCharT*& end)
             {
+ if (put_inf_nan(begin, end, val)) return true;
+ lcast_set_precision(out_stream, &val);
                 return shl_input_streamable(val);
             }
 


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