[spirit][iterator] position_iterator regression in 1.37.0

When using this type:
boost::spirit::position_iteratorstd::string::const_iterator
I get a static assertion failure:
..\..\lib\boost_1_37_0\boost/iterator/iterator_adaptor.hpp(230) : error
C2027: u
se of undefined type 'boost::STATIC_ASSERTION_FAILURE<x>'
with
[
x=false
]
..\..\lib\boost_1_37_0\boost/iterator/iterator_adaptor.hpp(335)
: see re
ference to function template instantiation 'void
boost::detail::iterator_adaptor
_assert_traversal

2008/11/4 Rainer Deyke
When using this type:
boost::spirit::position_iteratorstd::string::const_iterator
This happened because position_iterator's tag has been changed to be a forward iterator - before it was incorrectly labelled as the same type of iterator as the underlying iterator, but it didn't implement them. So iterator adaptor was supplying a buggy implementation of those methods. It looks like you're using 'operator+' to increase the iterator, it wouldn't give the correct position and could easily be jumping over the wrong number of characters. If you're code was previously compiling, and you were using position_iterator to get the position, you'll probably get the wrong position. Since you didn't include any code, my suggestion is that you should use 'boost::next' to advance the iterator. Daniel
participants (2)
-
Daniel James
-
Rainer Deyke