Subject: [Boost-bugs] [Boost C++ Libraries] #5494: lexical_cast<unsigned int>("-1") fails to throw
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-04-21 07:46:18
#5494: lexical_cast<unsigned int>("-1") fails to throw
----------------------------------------------------+-----------------------
Reporter: Rupert Kittinger-Sereinig <rks@â¦> | Owner: nasonov
Type: Bugs | Status: new
Milestone: To Be Determined | Component: lexical_cast
Version: Boost 1.45.0 | Severity: Problem
Keywords: lexical_cast |
----------------------------------------------------+-----------------------
The following fails to throw:
std::cout << boost::lexical_cast<unsigned int>(std::string("-1"))
<< std::endl;
output: 4294967295
which looks a lot like static_cast<unsigned int>(-1)
boost version: 1.45
compiler: g++ (Debian 4.4.5-8) 4.4.5
For my project, this is a serious problem since lexical_cast is used for
input validation
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/5494> 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:06 UTC