Boost C++ Libraries: Ticket #12488: read_string_while duplicates character https://svn.boost.org/trac10/ticket/12488 <p> Streaming, e.g. "1W" into a multiprecision number will correctly recognize 1, but the first character after the number will be duplicated (from "1W", "WW" is left in the stream). </p> <p> The cause is the line </p> <blockquote> <p> is.rdbuf()-&gt;sputbackc(static_cast&lt;char&gt;(c)); </p> </blockquote> <p> in read_string_while. The character c does not have to be put back, because snextc first advances position, then returns the character at new position. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12488 Trac 1.4.3 George <juergen.sawinski@…> Thu, 29 Sep 2016 07:56:27 GMT attachment set https://svn.boost.org/trac10/ticket/12488 https://svn.boost.org/trac10/ticket/12488 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">test.cc</span> </li> </ul> <p> Test </p> Ticket George <juergen.sawinski@…> Thu, 29 Sep 2016 07:58:40 GMT <link>https://svn.boost.org/trac10/ticket/12488#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12488#comment:1</guid> <description> <p> Provided test file. Result: </p> <p> $ g++ -o test test.cc -lmpfr<br /> $ ./test <br /> 1.0X<br /> 1,'XX'<br /> $ </p> <p> Bug is present in 1.62.0, too. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>John Maddock</dc:creator> <pubDate>Sun, 23 Oct 2016 17:13:07 GMT</pubDate> <title>status, version, milestone changed; resolution set https://svn.boost.org/trac10/ticket/12488#comment:2 https://svn.boost.org/trac10/ticket/12488#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>version</strong> <span class="trac-field-old">Boost 1.61.0</span> → <span class="trac-field-new">Boost 1.62.0</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.63.0</span> </li> </ul> <p> Fixed in <a class="ext-link" href="https://github.com/boostorg/multiprecision/commit/1c2ecb6f6ec024d3b7901a50caeab706eda4225f"><span class="icon">​</span>https://github.com/boostorg/multiprecision/commit/1c2ecb6f6ec024d3b7901a50caeab706eda4225f</a>. </p> <p> Note that I generally need to do a lot more work on the iostream operators. </p> Ticket