Boost C++ Libraries: Ticket #5746: Bugs in lexical_cast<unsigned_char> and <long long> https://svn.boost.org/trac10/ticket/5746 <p> The following expressions throw bad_lexical_cast exceptions, when I believe they should succeed just fine: </p> <pre class="wiki">boost::lexical_cast&lt;unsigned char&gt;("128"); boost::lexical_cast&lt;unsigned char&gt;("64"); </pre><p> Conversion from smaller numbers such as "2" work just fine </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/5746 Trac 1.4.3 Antony Polukhin Fri, 12 Aug 2011 16:29:31 GMT <link>https://svn.boost.org/trac10/ticket/5746#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5746#comment:1</guid> <description> <p> lexical_cast library works just like std::stringstream. Lexical conversion to char, signed char and unsigned char is simply reading a byte from source but since the source has more than one byte, the exception is thrown. </p> <p> Such situations are described in FAQ, but not very obvious. I'll update the FAQ. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Antony Polukhin</dc:creator> <pubDate>Fri, 12 Aug 2011 16:30:33 GMT</pubDate> <title>owner, status, milestone changed https://svn.boost.org/trac10/ticket/5746#comment:2 https://svn.boost.org/trac10/ticket/5746#comment:2 <ul> <li><strong>owner</strong> changed from <span class="trac-author">nasonov</span> to <span class="trac-author">Antony Polukhin</span> </li> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.48.0</span> </li> </ul> Ticket Antony Polukhin Fri, 12 Aug 2011 17:04:33 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/5746#comment:3 https://svn.boost.org/trac10/ticket/5746#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/73705" title="Fixes #5746 Updates FAQ section of documentation">[73705]</a>) Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/5746" title="#5746: Bugs: Bugs in lexical_cast&lt;unsigned_char&gt; and &lt;long long&gt; (closed: fixed)">#5746</a> Updates FAQ section of documentation </p> Ticket