Weird error after moving code from Linux to Windows

Hamburger-san via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Jul 31 08:34:11 PDT 2015


I was expecting something to break, but I thought it'd be more 
along the lines of file paths...

For whatever reason, my compiler really doesn't like it when I 
try to access my Array!SomeStruct opIndex function. It gives me 
the following Error

Error: inout method 
std.container.array.Array!(SomeStruct).Array.opIndex is not 
callable using a mutable object

struct SomeStruct {
     AppState!U state;
     int id;
}
Array!(SomeStruct) states_; //can allocate to this fine
Array!(AppState!U) stack_;

void somefunction(){
     stack_.reserve(4);
     stack_ = make!(Array!(AppState!U));
     stack_.insertBack( (states_[0].state) ); //errors
}
void someotherfunction(){
     ...
     auto state = states_[aa]; //also errors
     ...
}

It compiles fine on my Linux machine and I can't figure out what 
I'm doing wrong here...


More information about the Digitalmars-d-learn mailing list