Will the D GC be awesome?

Marco Leise Marco.Leise at gmx.de
Wed Oct 10 05:12:18 PDT 2012


Am Fri, 05 Oct 2012 08:43:53 +0200
schrieb Jacob Carlborg <doob at me.com>:

> 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.

Thanks for this practical usage example. I always
ignored .tupleof. Next time I contemplate if I should make a
function take a "Rect" struct or four coordinates, I'll
remember that!

-- 
Marco



More information about the Digitalmars-d mailing list