Fixing const arrays
bearophile
bearophileHUGS at lycos.com
Sat Dec 10 14:48:18 PST 2011
kenji hara:
> It breaks IFTI rule,
What do you mean?
> and adding special case will make difficult to learn language.
I think that change proposed by Andrei A. (that I like) doesn't add a special case to D2. Currently (2.057beta) this works:
void main() {
immutable(int[]) a = [1, 2];
immutable(int)[] b = a;
}
Calling a function that accepts a immutable(int)[] with a immutable(int[]) means creating a local slice, it's similar. So I think Andrei A. removes a special case.
Bye,
bearophile
More information about the Digitalmars-d
mailing list