Subject: [Boost-bugs] [Boost C++ Libraries] #7977: functor_input example for multi_pass iterator has various issues
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-02-05 03:10:23
#7977: functor_input example for multi_pass iterator has various issues
------------------------------------------+---------------------------------
Reporter: Jeff Trull <edaskel@â¦> | Owner: djowel
Type: Bugs | Status: new
Milestone: To Be Determined | Component: spirit
Version: Boost Development Trunk | Severity: Problem
Keywords: |
------------------------------------------+---------------------------------
As given, the functor_input example in the multi_pass documentation (see
"How to write a functor for use with the functor_input InputPolicy") will
not compile, and once the compile issues are fixed, will not run
successfully. The issues are more than simply typos - among them are:
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.
I have attached a modified version of the example which works as described
in the documentation.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/7977> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:11 UTC