Boost C++ Libraries: Ticket #7977: functor_input example for multi_pass iterator has various issues https://svn.boost.org/trac10/ticket/7977 <p> As given, the functor_input example in the multi_pass documentation (see "How to write a functor for use with the functor_input <a class="missing wiki">InputPolicy</a>") will not compile, and once the compile issues are fixed, will not run successfully. The issues are more than simply typos - among them are: </p> <p> 1) operator() cannot be const, as it modifies the private member c_ 2) policies are given to multi_pass directly instead of through default_policy 3) the policies are in the wrong order (functor_input must be third, not first) 4) '\0' cannot be used as the EOF marker, because the multi_pass is_eof() member will return true in this case due to a comparison against the initialized curtok value of 0 - this may be a bug. </p> <p> I have attached a modified version of the example which works as described in the documentation. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7977 Trac 1.4.3 Jeff Trull <edaskel@…> Tue, 05 Feb 2013 03:11:25 GMT attachment set https://svn.boost.org/trac10/ticket/7977 https://svn.boost.org/trac10/ticket/7977 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">test_fi.cpp</span> </li> </ul> <p> Suggested replacement code </p> Ticket Joel de Guzman Tue, 05 Feb 2013 03:32:40 GMT owner changed https://svn.boost.org/trac10/ticket/7977#comment:1 https://svn.boost.org/trac10/ticket/7977#comment:1 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Joel de Guzman</span> to <span class="trac-author">Hartmut Kaiser</span> </li> </ul> Ticket Hartmut Kaiser Wed, 06 Feb 2013 13:20:04 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/7977#comment:2 https://svn.boost.org/trac10/ticket/7977#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> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/82759" title="Spirit: fix #7977: functor_input example for multi_pass iterator has ...">[82759]</a>) Spirit: fix <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/7977" title="#7977: Bugs: functor_input example for multi_pass iterator has various issues (closed: fixed)">#7977</a>: functor_input example for multi_pass iterator has various issues </p> Ticket