Brian Schott:
I recently upgraded EMSI's internal data processing library[1]
so that it will be compatible with the upcoming 2.066 release
and thought it might be useful to share my experience.
I suggest to update large programs more frequently than adjacent
compiler versions, because there is too much changed stuff.
5. A change to object.d broke a line of code that used "[]" as
the "defaultValue" argument to the get() function for AAs.
Casting "[]" to the expected type worked around this issue.
Indeed this doesn't compile, but perhaps it should:
void main() {
int[][int] aa;
int[] r = aa.get(0, []);
}
A current workaround (but it's not DRY, because 'aa' is repeated
twice):
void main() {
import std.traits: ValueType;
int[][int] aa;
int[] r = aa.get(0, ValueType!(typeof(aa)).init);
}
Bye,
bearophile