I'm trying to implement a opApply outside of struct scope
----
struct A{
        int[] arr;
}
int opApply(ref A a,int delegate(ref int) dg){
        return 0;
}
void main(){
        A a;
        foreach(i;a){//i just want it to compile
                
        }
}
----
when i try compiling, the compiler errors:
  test.d(9): Error: invalid foreach aggregate a
Is there any why i can put a opApply outside of a struct scope,if
so is there any why that the opApply can be templated

Reply via email to