On Monday, 22 May 2017 at 20:12:56 UTC, Enjoys Math wrote:
I had to employ const / immutable to some things to get passed
some compiler errors. Then the poisoning continues.
How do I get this code to run?
String's will hold a T[] which actually will not be modified by
the String methods ("immutable strings of T").
I did not want to use any immutable / const anywhere at first,
but by passing in [1,2,3]
Solved it by reverting back to original code (no const /
immutable) on struct and creating two constructors:
this(T[] s) {
this.s = s;
}
this(const(T)[] s) {
this.s = cast(T[]) s;
}