Error: cannot uniquely infer foreach argument types

Steven Schveighoffer schveiguy at yahoo.com
Fri Jun 14 10:26:54 PDT 2013


On Fri, 14 Jun 2013 13:13:06 -0400, Agustin  
<agustin.l.alvarez at hotmail.com> wrote:

> Hello, i'm trying to create a library with utilities classes like  
> containers using Java API. Could anyone help me?
>
> public interface Iterator(E) {
>     bool hasNext();
>     E next();
>     void remove();

Here is the issue (as bearophile explained)

>     int opApply(int delegate(ref E) delegation);


Also, you may want to try an already-created library that's similar to  
Java in some respects:

http://schveiguy.github.io/dcollections/

-Steve


More information about the Digitalmars-d-learn mailing list