[Issue 6365] AutoTupleDeclaration
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Jul 25 19:56:39 PDT 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6365
--- Comment #22 from bearophile_hugs at eml.cc 2011-07-25 19:56:30 PDT ---
Two quite useful use cases:
A)
int[] array = [1, 2]; // dynamic array
auto (x, y) = array; // raises a run-time exception if array.length != 2
B)
auto (x, y, z) = iota(3); // raises a run-time exception if the lazy Range
doesn't yield exactly 3 itens.
Is it possible to support them too?
Regarding those run-time errors for those assignments, they are already present
in the language:
int[] array = [1, 2, 3];
int[2] a2 = array[];
object.Exception at src\rt\arraycat.d(31): lengths don't match for array copy
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list