From: Jonathan Wakely <jwakely.gcc@gmail.com>
To: "François Dumont" <frs.dumont@gmail.com>
Cc: "libstdc++@gcc.gnu.org" <libstdc++@gcc.gnu.org>,
gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] libstdc++: Limit allocations in _Rb_tree 2/2
Date: Thu, 2 Mar 2023 10:43:31 +0000 [thread overview]
Message-ID: <CAH6eHdT58x77bZeAL0-4Mw7iS-5zBuFvkN3OZSCmSh4EXz+J=g@mail.gmail.com> (raw)
In-Reply-To: <195c8a11-acc7-1e78-091f-c7417d147e64@gmail.com>
On Thu, 2 Mar 2023 at 05:40, François Dumont via Libstdc++
<libstdc++@gcc.gnu.org> wrote:
>
> Just forget about this patch, bad idea.
>
> The key_type might have additional data not used for the comparison.
> This data would not be preserved if we were inserting the already stored
> equivalent key instead of the user provided.
Right. Key equivalence does not imply substitutability, or even equality.
struct Key {
int i = 0;
int j = 0;
bool operator<(const Key& k) const { return i < k.j; }
bool operator==(const Key& k) const { return i == k.i && j == k.j; }
};
next prev parent reply other threads:[~2023-03-02 10:43 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-02 18:20 [PATCH] libstdc++: Limit allocations in _Rb_tree François Dumont
[not found] ` <43172ea5-6729-02c5-d374-9537fff7eb4c@gmail.com>
2023-02-22 6:06 ` [PATCH] libstdc++: Limit allocations in _Rb_tree 1/2 François Dumont
2023-02-22 6:08 ` [PATCH] libstdc++: Limit allocations in _Rb_tree 2/2 François Dumont
2023-03-02 5:39 ` François Dumont
2023-03-02 10:43 ` Jonathan Wakely [this message]
2023-03-06 17:36 ` [PATCH] libstdc++: Limit allocations in _Rb_tree 1/2 Jonathan Wakely
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAH6eHdT58x77bZeAL0-4Mw7iS-5zBuFvkN3OZSCmSh4EXz+J=g@mail.gmail.com' \
--to=jwakely.gcc@gmail.com \
--cc=frs.dumont@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=libstdc++@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).