Apparently the OP intended to set it in foo(). If the data is actually mutable and there really is no way other than going against the type system, foo() must be called at least once and can be implemented like this:public void foo() { abc = [1,2,3,4]; cast(ubyte*)data = abc.ptr; }// ... B b = new B(); b.foo(); b.print(); // now OK Ali
Wow, i didn't know i could cast out constness from an lvalue. This is what i needed. I'll try it in my code as soon as i can. Thanks.
