[Boost-bugs] [Boost C++ Libraries] #11842: VC 2005 warning "conversion from '__w64 int' to streamsize" when lexical_cast from string to double.

Subject: [Boost-bugs] [Boost C++ Libraries] #11842: VC 2005 warning "conversion from '__w64 int' to streamsize" when lexical_cast from string to double.
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-12-12 15:42:13


#11842: VC 2005 warning "conversion from '__w64 int' to streamsize" when
lexical_cast from string to double.
------------------------------+--------------------------
 Reporter: l_ting@… | Owner: apolukhin
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: lexical_cast
  Version: Boost 1.59.0 | Severity: Problem
 Keywords: |
------------------------------+--------------------------
 Symptom: When cast to double as follows:

     double d = boost::lexical_cast<double>("123.4");;

 boost 1.59.0 has the following warning when compile on Visual studio 2005
 platform under Unicode.


 1>c:\boost-v1.59.0\include\boost-
 1_59\boost\lexical_cast\detail\converter_lexical_streams.hpp(587) :
 warning C4244: 'argument' : conversion from '__w64 int' to
 'boost::detail::basic_pointerbuf<charT,BufferT>::streamsize', possible
 loss of data

 Fix: Change line 586@
 boost\lexical_cast\detail\converter_lexical_streams.hpp

 From: buf.setbuf(const_cast<CharT*>(start), finish - start);
 To: buf.setbuf(const_cast<CharT*>(start),
 static_cast<std::streamsize>(finish - start));

 Please review. Thanks

 Ting

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/11842>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:19 UTC