boostorg / boostorg/unordered

Missing functionality in bulk visit

Open
#324 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
92
Forks
88
PR merge metrics
No merged PRs in 30d

Description

I want to write a concurrent cache where I can lookup multiple items at once:
```
template
std::vector> lookup(const concurrent_flat_map& map, const std::vector& keys){
std::vector> result;
map.cvisit(keys.begin(), keys.end(), [&](const auto& x){
// PROBLEM: how to get 'i'??
result[i] = x->second;
});
return result;
}
```

I can't find a way to write this with the current API. I would like a new function that traverses an additional iterator in the same order:
```
template
std::vector> lookup(const concurrent_flat_map& map, const std::vector& keys){
std::vector> result;
map.cvisit(keys.begin(), keys.end(), result.begin(), [&](const auto& x, auto& it){
*it = x->second;
});
return result;
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.