On Fri, 2010-11-12 at 11:15 -0800, Andrei Alexandrescu wrote: > 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.
I noted in a separate email that:
auto inputData = new Tuple ! ( long , long , real )
[ numberOfThreads ] ;
causes the error message:
pi_d2_parallelMap.d(30): Error: template instance template 'Tuple' is
not defined
pi_d2_parallelMap.d(30): Error: Tuple!(long,long,real) is used as a type
Clearly code you think is right and that is expected to work on D 2.050
isn't working for me :-( So either I guess there is a bug in D or, much
more likely, I am doing something wrong.
--
Russel.
=============================================================================
Dr Russel Winder t: +44 20 7585 2200 voip: sip:[email protected]
41 Buckmaster Road m: +44 7770 465 077 xmpp: [email protected]
London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
signature.asc
Description: This is a digitally signed message part
