Subject: Re: [Boost-bugs] [Boost C++ Libraries] #7661: lexical_cast throws exception when strings have more than one null terminators
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-11-08 21:43:28
#7661: lexical_cast throws exception when strings have more than one null
terminators
--------------------------------+-------------------------------------------
Reporter: pengxu7@⦠| Owner: apolukhin
Type: Bugs | Status: new
Milestone: To Be Determined | Component: lexical_cast
Version: Boost 1.52.0 | Severity: Problem
Resolution: | Keywords:
--------------------------------+-------------------------------------------
Comment (by marshall):
I don't think this is a bug.
If you catch the exception, and display the `what()`, it says:`bad lexical
cast: source type value could not be interpreted as target`.
I believe that what has happened is that it attempted to convert the two
character sequence `"0\0"` to an integer, and that failed. This is the
same thing that would happen if you appended (say), a 'Z' instead of a
'\0'.
Why would you expect that to succeed?
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/7661#comment:1> 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:11 UTC