From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 750AF3858D28; Tue, 29 Nov 2022 16:43:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 750AF3858D28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1669740200; bh=AxdNWHZCp2VZ6+D+GAz+GiiUaXiTYHj3xS1fo3GZqDI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=R82a2UiRo67rstjPbF7hEMuA8crPLKZs9+RHS7jrUaf6I/bqng9AbRe1vwGMRBpA3 Q7gdwlVDfe19ntNvTCP0sy3Z2As9Vl7MgUF5S/rkX/a0zebvgfjJCyan1LQQ8/quNl 2AVHryV0bEzPzws7hKItT6hZSak8hP3H28mnhoTM= From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/107850] [12 Regression] std::erase_if (map) forces predicate to takes a const value_type Date: Tue, 29 Nov 2022 16:43:20 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 12.1.0 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: redi at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.3 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D107850 --- Comment #9 from Jonathan Wakely --- The problem with side effects is not that they happen more than once, but t= hat they happen at all. The algorithm is called "erase_if" so it's surprising i= f it actually mutates the remaining elements, rather than just removing some. Wh= at you want is a different algorithm, and so should have a different name.=