Opened 10 years ago
Closed 10 years ago
#7977 closed Bugs (fixed)
functor_input example for multi_pass iterator has various issues
Reported by: | Owned by: | Hartmut Kaiser | |
---|---|---|---|
Milestone: | To Be Determined | Component: | spirit |
Version: | Boost Development Trunk | Severity: | Problem |
Keywords: | Cc: |
Description
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.
Attachments (1)
Change History (3)
by , 10 years ago
Attachment: | test_fi.cpp added |
---|
comment:1 by , 10 years ago
Owner: | changed from | to
---|
comment:2 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Suggested replacement code