[Issue 6365] AutoTupleDeclaration
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Jul 24 07:38:50 PDT 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6365
--- Comment #17 from Kenji Hara <k.hara.pg at gmail.com> 2011-07-24 07:38:49 PDT ---
(In reply to comment #16)
> How does it behave for 0-tuples and 1-tuples?
I think 1-element tuple expansion should be allowed.
Now my patch's this support is incomplete. I'll improve it.
// 1-tuple expansion
auto (x1) = [10];
(auto x2) = tuple(10);
(auto x3) = tuple(10)[0..1];
(int x4) = TypeTuple!(10);
assert(x1 == 10);
assert(x2 == 10);
assert(x3 == 10);
assert(x4 == 10);
The 0-element tuple with TupleDeclaration should be error.
Because they has no elements, so expansion cannot get value.
//auto () = [];
//(auto ) = tuple();
--
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