std.paralellism.Task value type problems

Benjamin Thaut via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Oct 19 08:28:25 PDT 2016


I would like to use std.paralellism.TaskPool to schedule various 
tasks I create. The problem however is that these tasks don't 
have a lifetime which is bound to any function scope I have. So I 
need to create a new task object on the heap and push it into a 
array for bookkeeping. The problem however is that 
std.paralellism.Task is a struct and the only way to instanciate 
it is to use std.paralelism.task which returns it as a value. I 
have no idea at the moment how to allocate a instance of 
std.paralellism.Task on the heap. Any suggestions?

Kind Regards
Benjamin Thaut


More information about the Digitalmars-d-learn mailing list