From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CF254384402A; Thu, 9 Jul 2020 14:46:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CF254384402A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1594305977; bh=8KBX4CG8DVyVB0TFxfJ7fA8Q4O2oCLt5v1Uqi3teRSs=; h=From:To:Subject:Date:In-Reply-To:References:From; b=D3M29CsJ3g7NBu93qYcGJ68gOU99Aso0tj5BHBF+c3TvehS7fns9jtymYJmR9l5po d8pUChfebMmwmJoJcpbOzYlZVBQatkiSoNiSj+oh1XgfCf30XcSDHIy1w0+2fg0tdI f+eWQPKHUHEHWcDwnrlWeHy3zd3ni5b2NNu0NbGQ= From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/96088] Range insertion into unordered_map is less effective than a loop with insertion Date: Thu, 09 Jul 2020 14:46:17 +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: 11.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jul 2020 14:46:17 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D96088 --- Comment #4 from Jonathan Wakely --- (In reply to Marc Glisse from comment #3) > > Adding hash::operator()(string_view) is an interesting idea for= the > > standard though. >=20 > Indeed. If we want to, I think it is possible to add some overloads for w= hen > the argument is exactly const char* or string_view, which should remain > conforming and provide a significant part of the benefits. It would probably have to be: template requires same_as> size_t operator()(T) const; otherwise it can introduce ambiguities for things convertible to both string and string_view. But that annoyance aside, it seems worth exploring.=