Function, signatures and tuples

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Fri Nov 12 11:15:53 PST 2010


On 11/12/10 11:13 AM, Russel Winder wrote:
> Is there an easy explanation of why I cannot do:
>
>          real partialSum ( immutable Tuple ! ( long , long , real )
>          data )
>
> but instead have to do:
>
>          real partialSum ( T ... ) ( T data )
>
> to be frank I really don't get this latter which is what compiles -- I
> have no idea if it works yet there are other problems with my code.
> Specifically, how do I create an array of tuples?

Doesn't this help?

auto tuples = new Tuple!(long, long, real)[128];

Tuple is a type like any other.


Andrei


More information about the Digitalmars-d mailing list