deadalnix:
Tuple unpacking is necessary for things like bypair. Why not
unpack consistently ?
I'm all for unpacking consistently, but to reach consistency you
first have to break something, the iteration on arrays or the
iteration on ranges of tuples. The first is documented and it's
presen
Tuple unpacking is necessary for things like bypair. Why not
unpack consistently ?
I loved this feature when I first found out about it but after
reading your arguments against on the bug tracker I have to agree
with your position. It would be much nicer if it worked with
uniform tuple syntax like
foreach (i, {x,y}; [tuple('a',`b`),tuple('c',`d`)])
where i is size_t and x
I strongly suggest to "burn with fire", I mean, warn and then
deprecate the special case of automatic tuple unpacking in
foreach loops in dmd 2.067:
void main() {
import std.typecons, std.range;
auto data1 = [tuple("red", 10), tuple("blue", 20)];
foreach (x, y; data1) {
pr