Skip to content

Commit

Permalink
Fix compilation error.
Browse files Browse the repository at this point in the history
With `-Werror` gcc-14.1.1 (with libstdc++-14) emits an error:
`error: ignoring return value of _FIter std::remove_if(_FIter, _FIter, _Predicate)
... ...
declared with attribute nodiscard [-Werror=unused-result]`.
Use cast to `void` to avoid it.
  • Loading branch information
chestnykh authored and dbabokin committed Jul 7, 2024
1 parent 0bfbe4f commit a1cbc45
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/gen_policy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ void GenPolicy::uniformProbFromMax(std::vector<Probability<T>> &distr,

template <class T, class U>
void GenPolicy::removeProbability(std::vector<Probability<T>> &orig, U id) {
std::remove_if(
(void)std::remove_if(
orig.begin(), orig.end(),
[&id](Probability<T> &elem) -> bool { return elem.getId() == id; });
}

0 comments on commit a1cbc45

Please sign in to comment.