immutable and std.parallelism.Task

Andrew Wiley wiley.andrew.j at gmail.com
Thu Aug 18 00:39:59 PDT 2011


I'm pretty sure this is a bug, but the error makes me think I'm somehow
using immutable incorrectly:

import std.parallelism;

class Test {
}

void doSomething(immutable(Test) test) {
}

void main() {
        immutable(Test) test = new immutable(Test)();
        taskPool().put(task!(doSomething)(test));
}


compiler output:
Error: can only initialize const member __args_field_0 inside constructor
Error: this is not mutable
/usr/include/d2/4.6.0/std/parallelism.d:734: Error: template instance
std.parallelism.Task!(doSomething,immutable(Test)) error instantiating
tasktest.d:11:        instantiated from here:
task!(doSomething,immutable(Test))
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20110818/984c7009/attachment.html>


More information about the Digitalmars-d mailing list