[Boost-bugs] [Boost C++ Libraries] #13536: boost::lexical_cast<int>(" 1 ") can no longer handle whitespace

Subject: [Boost-bugs] [Boost C++ Libraries] #13536: boost::lexical_cast<int>(" 1 ") can no longer handle whitespace
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2018-04-24 14:25:24


#13536: boost::lexical_cast<int>(" 1 ") can no longer handle whitespace
--------------------------------+-----------------------------
 Reporter: maxim.egorushkin@… | Owner: Antony Polukhin
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: lexical_cast
  Version: Boost 1.61.0 | Severity: Showstopper
 Keywords: |
--------------------------------+-----------------------------
 boost::lexical_cast can no longer handle whitespace when converting
 strings to integers:

 {{{
     #include <string>
     #include <iostream>
     #include <boost/lexical_cast.hpp>

     int main() {
         auto i = boost::lexical_cast<int>(" 1 ");
         std::cout << i << '\n';
     }
 }}}

 The above incorrectly throws an exception.

 The correct result of boost::lexical_cast<int>(" 1 ") is `1` and no
 exception.

 At least boost version 1.54 did not have this problem.

-- 
Ticket URL: <https://svn.boost.org/trac10/ticket/13536>
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 : 2018-04-24 14:32:34 UTC