
In the private part of my own iterator adaptor called skip_iterator, I would
like to write the following:
private:
typedef typename skip_iterator::iterator_adaptor_::difference_type
difference_type;
void advance(difference_type n);
difference_type distance_to(const skip_iterator& x) const;
because it looks nice. What I get from gcc 3.4.6 is strange:
skip_iterator.hpp:22: error: `typedef ptrdiff_t
skip_iterator<__gnu_cxx::__normal_iterator

Mark Ruzon wrote:
In the private part of my own iterator adaptor called skip_iterator, I would like to write the following:
private: typedef typename skip_iterator::iterator_adaptor_::difference_type difference_type; void advance(difference_type n); difference_type distance_to(const skip_iterator& x) const;
because it looks nice. What I get from gcc 3.4.6 is strange:
You seemed to redefine difference_type as private, then it is inaccessible from iterator users. You might want to place it in public or use a "different" name. private: typedef typename skip_iterator::iterator_adaptor_::difference_type diff_t; void advance(diff_t n); -- Shunsuke Sogame
participants (2)
-
Mark Ruzon
-
shunsuke