Function, signatures and tuples

Russel Winder russel at russel.org.uk
Sat Nov 13 02:43:03 PST 2010


On Sat, 2010-11-13 at 08:18 +0000, Iain Buclaw wrote:
[ . . . ]
> import std.typecons; ?

Hummm... I thought I had put that in but clearly I had not :-((  OK so
that explains the bulk of the problems on this code, I knew it was
something stupid on my part, thanks for spotting it.

However, now we may be getting to something more serious.  The line:

         foreach ( i ; 0 .. numberOfTasks ) { inputData[i] = tuple ( 1 + i * sliceSize , ( i + 1 ) * sliceSize , delta ) ; }

now results in the error:

        /home/users/russel/lib.Linux.x86_64/DMD2/bin/../../src/phobos/std/typecons.d(662): Error: can only initialize const member _field_field_2 inside constructor
        /home/users/russel/lib.Linux.x86_64/DMD2/bin/../../src/phobos/std/typecons.d(26): Error: template instance std.typecons.tuple!(long,long,immutable(double)) error instantiating

Which at first sight seems to indicate an error in the typecons package
of Phobos.  On the other hand, it is probably more reasonable to assume
I still have something stupid wrong in my code.
-- 
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/20101113/b254327f/attachment.pgp>


More information about the Digitalmars-d mailing list