Skip to content

Commit

Permalink
Merge pull request #1168 from andralex/5658
Browse files Browse the repository at this point in the history
Fix Issue 5658 - Undocumented fields in std.typecons.Tuple
  • Loading branch information
alexrp committed Feb 25, 2013
2 parents dae6123 + 075db4d commit 2b00a2a
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions std/typecons.d
Expand Up @@ -379,10 +379,27 @@ public:
*/
alias staticMap!(extractType, fieldSpecs) Types;

Types field;
/**
Use $(D t.expand) for a tuple $(D t) to expand it into its
components. The result of $(D expand) acts as if the tuple components
were listed as a list of values. (Ordinarily, a $(D Tuple) acts as a
single value.)
Examples:
----
auto t = tuple(1, " hello ", 2.3);
writeln(t); // Tuple!(int, string, double)(1, " hello ", 2.3)
writeln(t.expand); // 1 hello 2.3
----
*/
Types expand;
mixin(injectNamedFields());
alias field expand;
alias field this;

// This is mostly to make t[n] work.
alias expand this;

// backwards compatibility
alias field = expand;

// This mitigates breakage of old code now that std.range.Zip uses
// Tuple instead of the old Proxy. It's intentionally lacking ddoc
Expand Down

0 comments on commit 2b00a2a

Please sign in to comment.