Comment #0 by andrej.mitrovich — 2013-04-01T23:54:21Z
struct Tuple(Types...)
{
// Error: Types is not a member of Tuple
alias Types this;
// ok: workaround
alias TypeTuple = Types;
alias TypeTuple this;
}
void main()
{
alias T = Tuple!int;
}
A light-weight implementation of a Tuple:
struct Tuple(Types...)
{
alias TypeTuple = Types;
alias TypeTuple this;
}
alias Tuple!
(
int
,Tuple!(float, string)
) list;
void main()
{
pragma(msg, list[0]);
pragma(msg, list[1]);
pragma(msg, list[1][0]);
pragma(msg, list[1][1]);
}
Comment #1 by andrej.mitrovich — 2016-08-27T23:20:49Z
What was I thinking when I filed this. Multi-type subtyping doesn't work (yet), perhaps that was my end-goal. But that would require instances in any case.