[Graph] const safety in edge_list_impl::edge_iterator

11 Feb
2018
11 Feb
'18
8:20 p.m.
Hello, I am wondering if there is a particular reason why the == and != operators for edge_list_impl::edge_iterator (defined in boost/graph/edge_list.hpp) are not marked const: // The implementation class for edge_list. template <class G, class EdgeIter, class T, class D> class edge_list_impl { public: ... struct edge_iterator { ... bool operator==(const self& x) { return _iter == x._iter; } bool operator!=(const self& x) { return _iter != x._iter; } EdgeIter _iter; edge_id _i; }; ... }; Also, it does not seem correct to have different const qualifiers for the operands of these operators (the above effectively says that the right operand is const, but the left operand may be changed). Thanks, Hormoz
2665
Age (days ago)
2665
Last active (days ago)
0 comments
1 participants
participants (1)
-
Hormoz Zarnani