dropped [c]visit_until

This commit is contained in:
joaquintides committed 2023-07-24 20:13:18 +02:00
1 parent 5a4d93a72d
commit 470abf41d8
5 files changed
+5 -155

No files matched your search

+4 -10
View File
@@ -162,23 +162,17 @@ Traversal can be interrupted midway:
int key = 0;
int value = ...;
bool found = m.visit_until([&](const auto& x) {
bool found = !m.visit_while([&](const auto& x) {
if(x.second == value) {
key = x.first;
return true; // finish
return false; // finish
}
else {
return false; // keep on visiting
return true; // keep on visiting
}
});
if(found) { ... }
// check if all values are != 0
bool all_ok = m.visit_while([&](const auto& x) {
return x.second != 0;
});
----
There is one last whole-table visitation operation, `erase_if`:
@@ -190,7 +184,7 @@ m.erase_if([](auto& x) {
});
----
`visit_until`, `visit_while` and `erase_if` can also be parallelized. Note that, in order to increase efficiency,
`visit_while` and `erase_if` can also be parallelized. Note that, in order to increase efficiency,
whole-table visitation operations do not block the table during execution: this implies that elements
may be inserted, modified or erased by other threads during visitation. It is
advisable not to assume too much about the exact global state of a `boost::concurrent_flat_map`