Listing 1: Excerpt from the view's iterator interface.
template <typename RawIterator> class view_iterator { public: // note the additional dereference in the following methods reference operator*() { return **raw_iterator_; } pointer operator->() { return *raw_iterator_; } reference operator[](int n) { return *(raw_iterator_[n]); } // "normal" iterator interface view_iterator & operator++() { ++raw_iterator_; return *this; } view_iterator & operator--() { --raw_iterator_; return *this; } // ... private: RawIterator raw_iterator_; };