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? TDPL has little on
tuples (p.163 basically) and the online manual has little as well. I
tried:
auto inputData = Tuple ! ( long , long , real )
[ numberOfThreads ] ;
but this errors out with:
pi_d2_parallelMap.d(26): Error: template instance template 'Tuple' is
not defined
pi_d2_parallelMap.d(26): Error: Tuple!(long,long,real) must be an array
or pointer type, not void
what is worse trying to set values in the array:
foreach ( i ; 0 .. numberOfThreads ) { inputData[i] = tuple ( 1 + i *
sliceSize , ( i + 1 ) * sliceSize , delta ) ; }
I get the error:
pi_d2_parallelMap.d(27): Error: undefined identifier tuple
Please tell me I am being stupid and that I should read some specific
reference of TFM :-)
Thanks.
--
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
