I have quite complicated data structure (class-based) and I need a copy of it in a Task (std.parallelism). There is a simplification of data structure and my program:
class A { B [] arr; } class B { C c; } class C { A a; } void main () { a = new A(); ... // Further initialization of data structure auto taskObject = new TaskObject( a ); auto t = task(taskObject); taskPool.put( t ); } Now "a" in my task is the same as "a" in main thread and I'd like a local copy - to be precise I need to make changes to a in the task, but they should not affect main copy. Is it possible to somehow create copy automatically when creating a task, or do I need to create it myself? If the latter - is there anything in std lib that helps with creation of deep clones or an I completely on my own? -- Marek Janukowicz