Reversing a string

JN 666total at
Fri Jan 11 08:45:12 UTC 2019

On Friday, 11 January 2019 at 08:15:01 UTC, rikki cattermole 
> Note the immutable, it means you cannot modify individual 
> values. Which is a problem for reverse because it modifies in 
> place.

The error message is kind of unfortunate. This is a simple 
usecase and the error message is undecipherable already. It'd be 
cool if the compiler could try to strip immutability, and if the 
type matches then, throw an error something like "Cannot pass 
immutable char[] to reverse, did you mean char[]?".

More information about the Digitalmars-d-learn mailing list