Will the D GC be awesome?

Jacob Carlborg doob at me.com
Thu Oct 4 23:43:53 PDT 2012


On 2012-10-05 04:57, timotheecour wrote:

> Why not simply introduce an "expand" property for structs?
> ----
> foo(s.expand) //equivalent to foo(s.a,s.b)
> ----
> That would be the exact analogous of expand for tuples and would
> maintain a sane type system .

We already have the .tupleof property:

struct Foo
{
     int x;
     int y;
}

void foo (int a, int b)
{
     writeln(a, " ", b);
}

void main ()
{
     auto f = Foo(1, 2);
     foo(f.tupleof);
}

This works today and I'm pretty sure it has for a long time.

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list