www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Using Maps with Tuples.

Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

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 =3D new Tuple ! ( int , int , double ) [ numberOfTas=
ks ] ;
        foreach ( i ; 0 .. numberOfTasks ) { inputData[i] =3D tuple ( i , c=
ast ( int ) ( sliceSize ) , cast ( double ) ( delta ) ) ; }

are in a piece of code that works exactly as expected.  If I replace
this with:

	auto inputData =3D map ! ( ( i ) { return tuple ( i , cast ( int ) ( slice=
Size ) , cast ( double ) ( delta ) ) ; } ) ( iota ( numberOfTasks ) ) ;

then I get:

        pi_d2_sequentialMap.d(40): Error: function std.algorithm.Map!(parti=
alSum,Map!(__dgliteral1,Iota!(int,uint))).Map.back cannot get frame pointer=
 to execute
        pi_d2_sequentialMap.d(40): Error: function std.algorithm.Map!(parti=
alSum,Map!(__dgliteral1,Iota!(int,uint))).Map.front cannot get frame pointe=
r to execute
        pi_d2_sequentialMap.d(40): Error: function std.algorithm.Map!(parti=
alSum,Map!(__dgliteral1,Iota!(int,uint))).Map.opIndex cannot get frame poin=
ter to execute
        /home/users/russel/lib.Linux.x86_64/DMD2/bin/../../src/phobos/std/a=
lgorithm.d(187): Error: function std.algorithm.Map!(partialSum,Map!(__dglit=
eral1,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.=20
--=20
Russel.
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder ekiga.n=
et
41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel russel.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder
Mar 06 2011