Am Fri, 05 Oct 2012 08:43:53 +0200
schrieb Jacob Carlborg <[email protected]>:

> 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

Reply via email to