From a1cbc45ec54ac460bd224153d34bec4dbb3983e2 Mon Sep 17 00:00:00 2001 From: Dmitry Chestnykh Date: Sun, 7 Jul 2024 13:17:04 +0300 Subject: [PATCH] Fix compilation error. 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. --- src/gen_policy.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gen_policy.cpp b/src/gen_policy.cpp index 432be8f..37cdf1f 100644 --- a/src/gen_policy.cpp +++ b/src/gen_policy.cpp @@ -537,7 +537,7 @@ void GenPolicy::uniformProbFromMax(std::vector> &distr, template void GenPolicy::removeProbability(std::vector> &orig, U id) { - std::remove_if( + (void)std::remove_if( orig.begin(), orig.end(), [&id](Probability &elem) -> bool { return elem.getId() == id; }); }