3 Jun
2002
3 Jun
'02
10:38 a.m.
Hi, I'm struggling to understand how to use Iterator Adaptors, due to a lack of simple examples. This is disappointing, given that supposedly "Using iterator_adaptor, you can easily implement an iterator class" (www.boost.org/libs/utility/iterator_adaptors.htm). Can anyone help, by explaining how to implement a random access iterator for a custom collection class? e.g.: template <class T> class DumbCollection { public: DumbCollection(T data[10]) { for (int i = 0; i < 10; i++) m_data[i] = data[i]; } iterator begin(); iterator end(); private: T m_data[10]; }; Thanks, Keith