From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by sourceware.org (Postfix) with ESMTP id 7A456398B429 for ; Tue, 9 Feb 2021 11:18:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 7A456398B429 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-564-1ViguolpO1CtOuR47bY80A-1; Tue, 09 Feb 2021 06:18:21 -0500 X-MC-Unique: 1ViguolpO1CtOuR47bY80A-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5CE611934101; Tue, 9 Feb 2021 11:18:20 +0000 (UTC) Received: from localhost (unknown [10.33.36.155]) by smtp.corp.redhat.com (Postfix) with ESMTP id E6B4517AE2; Tue, 9 Feb 2021 11:18:19 +0000 (UTC) Date: Tue, 9 Feb 2021 11:18:19 +0000 From: Jonathan Wakely To: =?iso-8859-1?Q?Fran=E7ois?= Dumont Cc: "libstdc++@gcc.gnu.org" , gcc-patches Subject: Re: [PATCH] Add unordered containers heterogeneous lookup Message-ID: <20210209111819.GZ3008@redhat.com> References: <7ec87f53-858e-c4b6-8f71-f48a0bc7dc19@gmail.com> <93b79981-d06f-99e4-5a81-7750f2f31cd1@gmail.com> <20210203112326.GB116817@redhat.com> <20210203112410.GC116817@redhat.com> MIME-Version: 1.0 In-Reply-To: X-Clacks-Overhead: GNU Terry Pratchett X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Disposition: inline Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00, BODY_8BITS, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libstdc++@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++ mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2021 11:18:24 -0000 On 04/02/21 21:20 +0100, François Dumont wrote: >    Considering that most of the code is already new code it doesn't >look like a major tradeoff duplicate some more code. > >    So here is a new proposal with only new code. However I left the >new few XXX_tr methods accessible even in C++11 because I'll use them >to propose a fix for PR 98066 when back in stage 1. OK. >    libstdc++: Add unordered containers heterogeneous lookup > >    Add unordered containers heterogeneous lookup member functions >find, count, contains and >    equal_range in C++20. Those members are considered for overload >resolution only if hash and >    equal functors used to instantiate the container have a nested >is_transparent type. > >    libstdc++-v3/ChangeLog: > >            * include/bits/stl_tree.h >            (__has_is_transparent, __has_is_transparent_t): Move... >            * include/bits/stl_function.h: ...here. >            * include/bits/hashtable_policy.h >(_Hash_code_base<>::_M_hash_code_tr): New.. >            (_Hashtable_base<>::_M_equals_tr): New. >            * include/bits/hashtable.h (_Hashtable<>::_M_find_tr, >_Hashtable<>::_M_count_tr, >            _Hashtable<>::_M_equal_range_tr): New member function >templates to perform >            heterogeneous lookup. >            (_Hashtable<>::_M_find_before_node_tr): New. >            (_Hashtable<>::_M_find_node_tr): New. >            * include/bits/unordered_map.h (unordered_map::find<>, >unordered_map::count<>, >            unordered_map::contains<>, unordered_map::equal_range<>): >New member function >            templates to perform heterogeneous lookup. >            (unordered_multimap::find<>, unordered_multimap::count<>, >            unordered_multimap::contains<>, >unordered_multimap::equal_range<>): Likewise. >            * include/bits/unordered_set.h (unordered_set::find<>, >unordered_set::count<>, >            unordered_set::contains<>, unordered_set::equal_range<>): >Likewise. >            (unordered_multiset::find<>, unordered_multiset::count<>, >            unordered_multiset::contains<>, >unordered_multiset::equal_range<>): Likewise. >            * include/debug/unordered_map >            (unordered_map::find<>, unordered_map::equal_range<>): >Likewise. >            (unordered_multimap::find<>, >unordered_multimap::equal_range<>): Likewise. >            * include/debug/unordered_set >            (unordered_set::find<>, unordered_set::equal_range<>): >Likewise. >            (unordered_multiset::find<>, >unordered_multiset::equal_range<>): Likewise. >            * testsuite/23_containers/unordered_map/operations/1.cc: >New test. >            * >testsuite/23_containers/unordered_multimap/operations/1.cc: New test. >            * >testsuite/23_containers/unordered_multiset/operations/1.cc: New test. >            * testsuite/23_containers/unordered_set/operations/1.cc: >New test. > >New test run under Linux x86_64. > >Ok to commit if all tests pass ? Yes, thanks for reworking it to only add new code.