I have a function with signature:
void partialSum ( immutable long start , immutable long end , immutable
real delta )
(it turns out the immutable is not a factor here I tried without it and
with const.)
I have a thread creation loop:
foreach ( i ; 0 .. numberOfThreads ) { threads[i] = new Thread ( bind (
& partialSum , 1 + i * sliceSize , ( i + 1 ) * sliceSize , delta ) ) ; }
but this does not work. I get the error message as below. I really
haven't a clue what I am doing wrong, but I bet it is something
trivially simple.
dmd -I. -O -release -inline -c -ofpi_d2_threads.o pi_d2_threads.d
/home/users/russel/lib.Linux.x86_64/DMD2/bin/../../src/phobos/std/traits.d(185):
Error: static assert "argument has no parameters"
/home/users/russel/lib.Linux.x86_64/DMD2/bin/../../src/phobos/std/bind.d(977):
instantiated from here: ParameterTypeTuple!(const(EmptySlot)*)
/home/users/russel/lib.Linux.x86_64/DMD2/bin/../../src/phobos/std/bind.d(1003):
instantiated from here: FuncReferenceParamsAsPointers_impl!(NullAlias)
/home/users/russel/lib.Linux.x86_64/DMD2/bin/../../src/phobos/std/bind.d(338):
instantiated from here: FuncReferenceParamsAsPointers!(NullAlias)
/home/users/russel/lib.Linux.x86_64/DMD2/bin/../../src/phobos/std/bind.d(660):
instantiated from here: BoundFunc!(void function(immutable
immutable(long) start, immutable immutable(long) end, immutable immutable(real)
delta),NullAlias,Tuple!(long,long,immutable(double)))
pi_d2_threads.d(31): instantiated from here: bind!(void
function(immutable immutable(long) start, immutable immutable(long) end,
immutable immutable(real) delta),long,long,immutable(double))
--
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
