[Boost-bugs] [Boost C++ Libraries] #8261: lexical_cast<unsigned> returns unexpected result when using with split_iterator<std::wstring::iterator>

Subject: [Boost-bugs] [Boost C++ Libraries] #8261: lexical_cast<unsigned> returns unexpected result when using with split_iterator<std::wstring::iterator>
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-03-07 10:59:30


#8261: lexical_cast<unsigned> returns unexpected result when using with
split_iterator<std::wstring::iterator>
--------------------------------------+-------------------------------------
 Reporter: s.a.moreno.a.s@… | Owner: apolukhin
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: lexical_cast
  Version: Boost 1.52.0 | Severity: Problem
 Keywords: |
--------------------------------------+-------------------------------------
 The following code will print "4948.4948" instead of expected "10.10"
 (This are ascii codes of the symbols instead of values):

 std::wstring wstr(L"10.10");
 typedef boost::split_iterator<std::wstring::iterator> wsplit_iter_t;
 wsplit_iter_t wdot_iter = boost::make_split_iterator( wstr,
 boost::first_finder(L "."));
 std::cout<<boost::lexical_cast<unsigned>(*wdot_iter++)<<'.'<<boost::lexical_cast<unsigned>(*wdot_iter++);

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/8261>
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:12 UTC