Closed GoogleCodeExporter closed 9 years ago
This is a huge oversight :(
Adding const iterators won't solve this issue - node.begin() for non-const node
would still return non-const iterator with the same issue.
The problem is that operator* in the iterator is non-const; the reason for it
is that it can't return a const-reference to xml_node, because that would make
calling non-const methods, such as remove, impossible. I can return it by
value, but there's no fix for operator-> here.
What I can do is I can add const versions of operator*/operator-> to the
existing iterators - this should not break the existing code (since they did
not work anyway), and should fix the problem.
Original comment by arseny.k...@gmail.com
on 16 Feb 2012 at 5:48
It's a little confusing. `xml_node::begin` is const but does not return a true
const_iterator. The issue with `container::begin` returning a normal iterator
is a known defect. Usually the declaration of the node has to be changed to
`const xml_node` to work around. Alternatively, there are the new `cbegin` and
`cend`. That said, I would like to see support for global `begin`/`end` as I
prefer them over the members.
Original comment by bootsare...@gmail.com
on 16 Feb 2012 at 8:03
Should be fixed in r858 - works with boost::make_filter_iterator from Boost
1.48.
Original comment by arseny.k...@gmail.com
on 14 Mar 2012 at 5:41
Original issue reported on code.google.com by
bootsare...@gmail.com
on 16 Feb 2012 at 1:37