Menu

#7 Get const iterator from non-const node

closed
nobody
None
5
2011-02-24
2011-02-24
No

The begin() and end() methods etc. are overloaded so that a const node gives a const_iterator and a non-const node gives a non-const iterator. But this means if you have a non-const node you can't get a const_iterator, which you might want if you are looking for something in a node you've made. Rather than add more overloads, a conversion from iterator to const_iterator might be doable.

Discussion

  • Jonathan Wallace

    I'm adding a cast operator in the iterator to do this, it will be available in the next release.

     
  • Jonathan Wallace

    • status: open --> closed