-6
Parallel.For(<your starting value >,<End criteria for loop>, delegate(int < your variable Name>)
{
// Your own code
});
上面我在C#中顯示了一些示例代碼。我想在C++/CLI中使用類似的功能,但我不知道如何使用這個表達式:「委託(int <您的變量名稱>)」。在C++/cli中並行for循環
['的std :: for_each'](http://en.cppreference.com/w/cpp/algorithm/for_each)與即將發佈的C++中的'parallel_policy' [執行策略](http://en.cppreference.com/w/cpp/algorithm/execution_policy_tag_t) 17標準應該可以做到。 –
所以什麼阻止你? 'Parallel.For'在* managed * C++中可用。 –
如果您使用Windows/VisualStudio,請嘗試使用Concurrency :: parallel_for – yms