
At Sat, 16 Apr 2011 09:55:31 +0900, Andrej van der Zee wrote:
Hi,
I am trying to implement an iterator using boost::iterator_facade. It works fine but it is very slow, I think because the distance() function takes lineair time as it is seems to be implemented in terms of increment(). I would like to implement the distance() function myself but I am not sure how. I tried to implement distance_to() like this:
class const_data_stream_iterator : public boost::iterator_facade
{ public: typedef boost::iterator_facade
facade_t; private:
friend class boost::iterator_core_access;
facade_t::difference_type difference_to(const_data_stream_iterator & to) const { ... } };
But this does not work. How can I do this?
You misspelled "distance_to." Fix the spelling and it should work better. -- Dave Abrahams BoostPro Computing http://www.boostpro.com