Using Maps with Tuples.
Russel Winder
russel at russel.org.uk
Sun Mar 6 09:13:02 PST 2011
I am wondering if this is a bug to be reported or (more likely) I have
just done the wrong thing.
The statements:
auto inputData = new Tuple ! ( int , int , double ) [ numberOfTasks ] ;
foreach ( i ; 0 .. numberOfTasks ) { inputData[i] = tuple ( i , cast ( int ) ( sliceSize ) , cast ( double ) ( delta ) ) ; }
are in a piece of code that works exactly as expected. If I replace
this with:
auto inputData = map ! ( ( i ) { return tuple ( i , cast ( int ) ( sliceSize ) , cast ( double ) ( delta ) ) ; } ) ( iota ( numberOfTasks ) ) ;
then I get:
pi_d2_sequentialMap.d(40): Error: function std.algorithm.Map!(partialSum,Map!(__dgliteral1,Iota!(int,uint))).Map.back cannot get frame pointer to execute
pi_d2_sequentialMap.d(40): Error: function std.algorithm.Map!(partialSum,Map!(__dgliteral1,Iota!(int,uint))).Map.front cannot get frame pointer to execute
pi_d2_sequentialMap.d(40): Error: function std.algorithm.Map!(partialSum,Map!(__dgliteral1,Iota!(int,uint))).Map.opIndex cannot get frame pointer to execute
/home/users/russel/lib.Linux.x86_64/DMD2/bin/../../src/phobos/std/algorithm.d(187): Error: function std.algorithm.Map!(partialSum,Map!(__dgliteral1,Iota!(int,uint))).Map.opSlice cannot get frame pointer to execute
which tells me which line is problematic, but doesn't give me a real
clue as to what is wrong.
--
Russel.
=============================================================================
Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.winder at ekiga.net
41 Buckmaster Road m: +44 7770 465 077 xmpp: russel at russel.org.uk
London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20110306/458f4ffc/attachment.pgp>
More information about the Digitalmars-d
mailing list