On Friday, 18 October 2024 at 12:07:24 UTC, Kadir Erdem Demir wrote:
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.

Reply via email to