Skip to content

parallel_for an unordered_map #41

@CliveWongTohSoon

Description

@CliveWongTohSoon

Is it possible to use unordered_map in parallel_for? I have tried using the following:

tbb::parallel_for(my_map.begin(), my_map.end(), [&](std::pair<uint16_t, std::vector<src_weight>> x) {
    // My code here
});

but I got a compilation error saying

error: no matching conversion for static_cast from 'int' to     'std::__1::__hash_map_const_iterator<std::__1::__hash_const_iterator<std::__1::__hash_node<std::__1::__hash_value_type<unsigned short,
      std::__1::vector<src_weight, std::__1::allocator<src_weight> > >, void *> *> >'

I wonder is there any trick to use unordered_map with tbb::parallel_for?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions