www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Re: Applying a tuple to a function (and more)

reply bearophile <bearophileHUGS lycos.com> writes:
Philippe Sigaud:
 Recently, bug 2800 was corrected and you can also directly access a tuple's
 fields by indexing:
 double d = tup[1];  // or simply:     auto d = tup[1];

This program doesn't work: import std.typecons; void main() { auto t = tuple(42, 3.14); double d = t[1]; } And I think bug 2800 is unrelated: http://d.puremagic.com/issues/show_bug.cgi?id=2800 Bye, bearophile
Sep 19 2010
parent bearophile <bearophileHUGS lycos.com> writes:
 This program doesn't work:
 
 import std.typecons;
 void main() {
     auto t = tuple(42, 3.14);
     double d = t[1];
 }
 
 
 And I think bug 2800 is unrelated:
 http://d.puremagic.com/issues/show_bug.cgi?id=2800

But now I have seen this: http://www.dsource.org/projects/phobos/changeset/2018 Sorry, bye, bearophile
Sep 19 2010