A iterator with a generic method next()?

Neal Gafter neal at gafter.com
Wed Nov 11 20:11:21 PST 2009


I can't imagine how one could correctly implement such a method.  Are you
just trying to hide a cast that needs to be in the code?   If so, just put
the cast in the code.

On Wed, Nov 11, 2009 at 6:02 PM, Paulo Levi <i30817 at gmail.com> wrote:

> Recently i'm thinking that a iterator with a
> <T> T next()  method is a good idea, for some uses. The interface is
> different from the normal iterator, so it can't be used for
> the for loop (or at least it would be fairly useless if so), but i'm
> thinking of using it as a proxy of ObjectInputStream + factories in
> case that the object in the file are not there (or the file doesn't
> exist), where the saved objects are of different types.
>
> Just tossing this idea into the melting pot.
>
>



More information about the coin-dev mailing list