In following code:
```d
int test(int x) { return --x; }
T test2(T)(T x) { return --x; }

void main()
{
   const int v = 3;
   writeln(test(v));
   writeln(test2(v)); // doesn't compile
}
```

test2 (just like test) works on a copy of x. Why is this copy const?!? If I copy a const or immutable object, most of the time I do so because I want to work with this value. Getting a const copy is never useful. If it were, why is it not const in test?

This also annoys me if I copy write protected files on windows - why on earth should the copy be write protected?

Is there a way to tell the compiler that it should discard "const" and "immutable" if it needs to create a copy?
Unqual!T doesn't work :-(

Reply via email to