You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As written in the title, I want to use the robin_map instead of std::unordered_map in lambda function.
Jumping into the code right away, the code below works well with std::unordered_map.
But, as robin_map returns const iterator, the below code cannot be compiled.
tsl::robin_map<KeyType, DataType> candidates;
tbb::parallel_for_each(candidates.begin(), candidates.end(), [&](auto &cand_)
{
if (some_condition)
{
cand_.second.to_be_del = true; // modifying const iterator
cand_.value().to_be_del = true; // errors: cand_ has no member function named 'value()'
}
});
As can be seen, I want to use tbb::parallel_for or tbb::parallel_for_each for faster computations.
So I would like to ask if there is a proper way to use robin_map and capture the iterator to modify the value within the lambda function!
Thank you in advance.
The text was updated successfully, but these errors were encountered:
Thank you for the great work
As written in the title, I want to use the
robin_map
instead ofstd::unordered_map
in lambda function.Jumping into the code right away, the code below works well with
std::unordered_map
.But, as
robin_map
returns const iterator, the below code cannot be compiled.As can be seen, I want to use
tbb::parallel_for
ortbb::parallel_for_each
for faster computations.So I would like to ask if there is a proper way to use
robin_map
and capture the iterator to modify the value within the lambda function!Thank you in advance.
The text was updated successfully, but these errors were encountered: