Struggling to implement parallel foreach...
Nicholas Wilson
iamthewilsonator at hotmail.com
Mon Jun 17 11:24:59 UTC 2019
On Monday, 17 June 2019 at 10:20:29 UTC, Ola Fosheim Grøstad
wrote:
> Is parallell for mandatory though?
For what Manu wants to do yes.
> In C++ it is an add-on, isn't it?
It's a standard library function.
The problem is that parallel foreach uses opApply, and the lambda
that it takes is not qualified as shared, which is a problem if
you want to try and use shared with it.
This is compounded by the fact that qualifiers don't work at all
(i.e. completely broken) on local functions, which the foreach
body passed to opApply is.
There is also the issue that access through the (once its fixed)
qualified captured context, then cannot implicitly convert to
shared (as oppose to const since everything will implicitly
convert to const). This will be alleviated under the new shared.
More information about the Digitalmars-d
mailing list