Cool thing about D, number #72

Luís Marques luismarques+spam at gmail.com
Fri Apr 27 16:44:43 PDT 2007


Bill Baxter wrote:
> I just realized today the coolness of tupleof for this kind of 
> situation.  You can make the function takes the plain floats
> 
>    do_something_at_point(float x, float y, float z);
> 
> And still call it using a Vec3f via tupleof!
> 
>    Vec3f world_origin;
>    ...
>    do_something_at_point(world_origin.tupleof);

I finally realize how useful tuples are!
Great contribution.

--
Luís



More information about the Digitalmars-d mailing list