Boost C++ Libraries: Ticket #6750: istream_iterator in spirit might have defect https://svn.boost.org/trac10/ticket/6750 <p> The following program yields a wrong parsing result: </p> <pre class="wiki">#include &lt;iostream&gt; #include &lt;vector&gt; #include &lt;algorithm&gt; #include &lt;iterator&gt; #include &lt;boost/spirit/include/qi.hpp&gt; #include &lt;boost/spirit/include/phoenix_core.hpp&gt; #include &lt;boost/spirit/include/phoenix_operator.hpp&gt; #include &lt;boost/spirit/include/phoenix_stl.hpp&gt; namespace spirit = boost::spirit ; namespace qi = boost::spirit::qi ; namespace ascii = boost::spirit::ascii ; namespace phoenix = boost::phoenix ; using qi::double_ ; using qi::_1 ; using phoenix::push_back ; using phoenix::ref ; int main (int argc, char* argv[]) { spirit::istream_iterator iter (std::cin), end ; std::vector&lt;double&gt; v ; bool r = spirit::qi::phrase_parse (iter, end, double_ [push_back (ref(v), _1)] % ',', ascii::space) ; if (r) { std::cout &lt;&lt; "vector: " ; std::copy (v.begin(), v.end(), std::ostream_iterator&lt;double&gt; (std::cout, ", ")) ; std::cout &lt;&lt; std::endl ; } return 0 ; } </pre><p> You may test it with input like "1,2,3,4" and the output is "vector: 1,2,3,44,". When we switch to std::getline and use the std::string::const_iterator, the result turns out fine. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/6750 Trac 1.4.3 Nikita Kniazev <nok.raven@…> Sun, 10 Dec 2017 15:43:55 GMT <link>https://svn.boost.org/trac10/ticket/6750#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6750#comment:1</guid> <description> <p> Cannot reproduce, it prints <code>vector: 1, 2, 3, 4, </code> for me. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Joel de Guzman</dc:creator> <pubDate>Wed, 13 Dec 2017 22:56:04 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/6750#comment:2 https://svn.boost.org/trac10/ticket/6750#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> Ticket