Boost logo

Boost Users :

From: Martin Weigel (gandalf_the_wanderer_at_[hidden])
Date: 2005-11-22 18:31:04


Hi,

counting_iterator.hpp defines the distance_to() member function as follows
(from CVS HEAD),

template <class OtherIncrementable>
difference_type
distance_to(counting_iterator<OtherIncrementable> const& y) const
{
...

Since the argument counting_iterator<OtherIncrementable> uses the default
values for CategoryOrTraversal and Difference, this distance_to() template
does not apply for counting_iterator's with other than the default values
for CategoryOrTraversal and Difference. In particular, for a
counting_iterator with non-default CategoryOrTraversal or Difference, the
necessary function

typedef counting_iterator<Incrementable, CategoryOrTraversal, Distance>
it_type;
it_type::distance_to(it_type const&)

cannot be instantiated from the above template, resulting in a compile-time
error.

Best,

Martin


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net