Boost logo

Boost :

From: George A. Heintzelman (georgeh_at_[hidden])
Date: 2001-10-26 10:42:40

> >How about generalizing even further: instead of specifying the end of
> >range by an iterator, allow an arbitrary function that takes
> >an iterator
> >as argument.
> And a reference to the container, of course.

No, I think OP would mean that that reference might be bound into the
arbitrary function (functor). Or another iterator to compare to might
be. Or a test for equality of the derefernce with another object. Or,
for some iterator classes, end() might be constant across containers,
and no binding is necessary.

I agree the generalization would be a good thing (I'd use it! I've been
salivating for a more solid Range class, and one better integrated with
containers/algorithms), but care needs to be taken that the easy/usual
cases aren't made harder by doing it.

George Heintzelman

Boost list run by bdawes at, gregod at, cpdaniel at, john at