Boost C++ Libraries: Ticket #6094: 1 secondALPHA should be an invalid input for a duration. https://svn.boost.org/trac10/ticket/6094 <p> I expect the following input to be an invalid </p> <p> 1 seconde </p> <p> to fail (in English). But it works without scanning the last 'e'. </p> <p> It seems that this is the current practice in the standard </p> <p> But this goes against current practice: </p> <pre class="wiki">#include &lt;sstream&gt; #include &lt;iostream&gt; int main() { std::istringstream in("1e+10"); int s = 10; in &gt;&gt; s; if (!in.fail()) std::cout &lt;&lt; s &lt;&lt; '\n'; else std::cout &lt;&lt; "failed\n"; char c = 0; in &gt;&gt; c; if (!in.fail()) std::cout &lt;&lt; c &lt;&lt; '\n'; else std::cout &lt;&lt; "failed\n"; } </pre><p> Outputs </p> <pre class="wiki">1 e </pre><p> I think, however that this is a different case, as integers and letters could be go together. </p> <p> I can understand that after </p> <p> 1 second </p> <p> any non alpha character could be accepted, but not an alphabetic. </p> <p> The solution could be simple. Once the unit keyword match, a check on the next character (if one) is done to ensure that isalpha(c) is false. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/6094 Trac 1.4.3 viboes Thu, 03 Nov 2011 23:09:04 GMT status, component changed https://svn.boost.org/trac10/ticket/6094#comment:1 https://svn.boost.org/trac10/ticket/6094#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">chrono</span> </li> </ul> Ticket viboes Wed, 21 Mar 2012 01:15:16 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/6094#comment:2 https://svn.boost.org/trac10/ticket/6094#comment:2 <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">invalid</span> </li> </ul> <p> It seems that the standard io works this way (no need to have white space separators, so fixed as invalid. </p> Ticket