It seems [=] functionality C++ does not exist in D. By using a helper function I made that example work.[...]
Because 'work' is captured, it is allocated on the heap. The loops are all assigning values to this 'work' in the heap. The values in front of 'work' are all overwritten, so after the thread runs, it prints the last value.