15 Aug
2011
15 Aug
'11
6:38 p.m.
I wrote an iterator by deriving from the boost::iterator_adaptor template. Now I need the const_iterator for my collection, too. The instructions for iterator_adaptor are not clear, but the implication is that I should transfer what I read from iterator_facade. So, is using a const type for the Value (the 3rd template argument) all it takes to write a proper const_iterator? (assuming the functions I supply are proper, too) So, I can just write my iterator as a template of T, passing T through as Value to the iterator_adaptor base class, and then instantiate _that_ with my value type and with const value type to make iterator and const_iterator respectively, right? —John