Sam
> For starters, your implementation of next() is wrong. See
> http://java.sun.com/javase/6/docs/api/java/util/Iterator.html. The
> correct, equivalent, implementation would be:
>
> Iter
Actually not. A Java iterator's next() method returns an element,
not an iterator. A closer match would be:
template
struct Iterator {
T::iterator ptr;
T::iterator end;
bool hasNext() const { return ptr != end; }
T next() { return *(ptr++); }
};
so that you can do:
for(Iterator
Something element = iter.next();
// ...
}
> Gosh, what the heck are they teaching in college, these days?
Java :)
/L
--
Lasse Reichstein Nielsen - lrn@hotpop.com
DHTML Death Colors:
'Faith without judgement merely degrades the spirit divine.'