documented non-const reference passing to erase_if (#312)

* documented non-const reference passing to erase_if

* prevented warning as error in Boost.Container build

* skipped tests for MinGW (https://github.com/boostorg/atomic/pull/70)

* correct reference link for previous commit is https://github.com/boostorg/atomic/issues/73

* commented previous disabled cases

* disabled cfoa_serialization_tests with TSAN

* fixed previous

* fixed previous

* fixed previous
This commit is contained in:
joaquintides
2025-05-31 18:08:37 +02:00
committed by GitHub
parent a64d81a378
commit 164cbe4e0f
8 changed files with 58 additions and 8 deletions

View File

@@ -1429,7 +1429,9 @@ Erases the element `x` with key equivalent to `k` if it exists and `f(x)` is `tr
[horizontal]
Returns:;; The number of elements erased (0 or 1).
Throws:;; Only throws an exception if it is thrown by `hasher`, `key_equal` or `f`.
Notes:;; The `template<class K, class F>` overload only participates in overload resolution if `std::is_execution_policy_v<std::remove_cvref_t<ExecutionPolicy>>` is `false`. +
Notes:;; `f` is passed a non-const reference to `x`. +
+
The `template<class K, class F>` overload only participates in overload resolution if `std::is_execution_policy_v<std::remove_cvref_t<ExecutionPolicy>>` is `false`. +
+
The `template<class K, class F>` overload only participates in overload resolution if `Hash::is_transparent` and `Pred::is_transparent` are valid member typedefs. The library assumes that `Hash` is callable with both `K` and `Key` and that `Pred` is transparent. This enables heterogeneous lookup which avoids the cost of instantiating an instance of the `Key` type.
@@ -1440,7 +1442,7 @@ The `template<class K, class F>` overload only participates in overload resoluti
template<class F> size_type erase_if(F f);
```
Successively invokes `f` with references to each of the elements in the table, and erases those for which `f` returns `true`.
Successively invokes `f` with non-const references to each of the elements in the table, and erases those for which `f` returns `true`.
[horizontal]
Returns:;; The number of elements erased.
@@ -1453,7 +1455,7 @@ Throws:;; Only throws an exception if it is thrown by `f`.
template<class ExecutionPolicy, class F> void erase_if(ExecutionPolicy&& policy, F f);
```
Invokes `f` with references to each of the elements in the table, and erases those for which `f` returns `true`.
Invokes `f` with non-const references to each of the elements in the table, and erases those for which `f` returns `true`.
Execution is parallelized according to the semantics of the execution policy specified.
[horizontal]

View File

@@ -1519,7 +1519,9 @@ Erases the element `x` with key equivalent to `k` if it exists and `f(x)` is `tr
[horizontal]
Returns:;; The number of elements erased (0 or 1).
Throws:;; Only throws an exception if it is thrown by `hasher`, `key_equal` or `f`.
Notes:;; The `template<class K, class F>` overload only participates in overload resolution if `std::is_execution_policy_v<std::remove_cvref_t<ExecutionPolicy>>` is `false`. +
Notes:;; `f` is passed a non-const reference to `x`. +
+
The `template<class K, class F>` overload only participates in overload resolution if `std::is_execution_policy_v<std::remove_cvref_t<ExecutionPolicy>>` is `false`. +
+
The `template<class K, class F>` overload only participates in overload resolution if `Hash::is_transparent` and `Pred::is_transparent` are valid member typedefs. The library assumes that `Hash` is callable with both `K` and `Key` and that `Pred` is transparent. This enables heterogeneous lookup which avoids the cost of instantiating an instance of the `Key` type.
@@ -1530,7 +1532,7 @@ The `template<class K, class F>` overload only participates in overload resoluti
template<class F> size_type erase_if(F f);
```
Successively invokes `f` with references to each of the elements in the table, and erases those for which `f` returns `true`.
Successively invokes `f` with non-const references to each of the elements in the table, and erases those for which `f` returns `true`.
[horizontal]
Returns:;; The number of elements erased.
@@ -1543,7 +1545,7 @@ Throws:;; Only throws an exception if it is thrown by `f`.
template<class ExecutionPolicy, class F> void erase_if(ExecutionPolicy&& policy, F f);
```
Invokes `f` with references to each of the elements in the table, and erases those for which `f` returns `true`.
Invokes `f` with non-const references to each of the elements in the table, and erases those for which `f` returns `true`.
Execution is parallelized according to the semantics of the execution policy specified.
[horizontal]

View File

@@ -1514,6 +1514,8 @@ for (auto i = c.begin(), last = c.end(); i != last; ) {
}
return original_size - c.size();
```
+
Note that the references passed to `pred` are non-const.
=== Serialization

View File

@@ -1766,7 +1766,9 @@ for (auto i = c.begin(), last = c.end(); i != last; ) {
}
}
return original_size - c.size();
```
```
+
Note that the references passed to `pred` are non-const.
=== Serialization

View File

@@ -1486,6 +1486,8 @@ for (auto i = c.begin(), last = c.end(); i != last; ) {
}
return original_size - c.size();
```
+
Note that the references passed to `pred` are non-const.
=== Serialization

View File

@@ -1618,6 +1618,8 @@ for (auto i = c.begin(), last = c.end(); i != last; ) {
}
return original_size - c.size();
```
+
Note that the references passed to `pred` are non-const.
=== Serialization