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();
int opApply(int delegate(ref E) delegation);
}
public class AbstractCollection(E) : Collection!E {
.....
E[] toArray(E[] dst = null) {
size_t count = size();
if( dst.length < count ) {
dst.length = count;
}
Iterator!E it = iterator();
foreach(int i,E e; it) { -> Error: cannot uniquely infer
foreach argument types
dst[i] = e;
}
return dst[0 .. count];
}
.....
}