From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by sourceware.org (Postfix) with ESMTPS id 5A8E33858016 for ; Wed, 11 May 2022 17:04:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5A8E33858016 Received: by mail-wr1-x42b.google.com with SMTP id j25so2860455wrc.9 for ; Wed, 11 May 2022 10:04:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:from:to:references:in-reply-to :content-transfer-encoding; bh=3vXKriCdR6F00vglU0JKhSHdNjOXn5GKpyoLKJSITyI=; b=p0dhxW0u8Z9VYLrbj1YjQXk2CchH+RJk/dvPaav9dMz4CCc772aVLsvyvwcDqHZdJn m7j8E8cMKFpl9RSYWVJ5gEUYlLpGdaoamXf8qps8t9VZh7pLOo9k0+f+fZZV+s7Z3gNU EK89/5hqjZAritxs/mF8VfUOBv/onQ5URdxgR27sCD5txXRU0zejT8WUHRcUztsvXMM1 BE9EQblStE16lRtCU7QL8qBF8CtqviQ1EViv3Gy+zgPL0ko1rDaU9Hp4kHjXLAjTxAV7 PRrW4l7Ltc5xYlqxNhhZsn0CR/67bJ3J96+9YeLkgyDixkrNsD7Wums8BLronnuroAKw yHnw== X-Gm-Message-State: AOAM533hyinMbTuIdLc6Mq13kAPAH+G/oXFl5qNNcrL8U0vftjQENNK6 fzK49Y7uVKMN8ndH84JvNDnZG0aNG+M= X-Google-Smtp-Source: ABdhPJxyMgnxKCRIEs/nmBxvET3AyBX0cADaGl+W++zJAZFtfS0MQ/9gpk3A57GCFziJ0ks3ywZPkw== X-Received: by 2002:a5d:4fc7:0:b0:20c:dcd2:b088 with SMTP id h7-20020a5d4fc7000000b0020cdcd2b088mr3903496wrw.54.1652288642797; Wed, 11 May 2022 10:04:02 -0700 (PDT) Received: from [10.22.6.50] ([109.190.253.11]) by smtp.googlemail.com with ESMTPSA id n8-20020a05600c4f8800b0039444973258sm557860wmq.0.2022.05.11.10.03.55 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 11 May 2022 10:04:02 -0700 (PDT) Message-ID: Date: Wed, 11 May 2022 19:03:52 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: Re: [PATCH][_Hashtable] Fix insertion of range of type convertible to value_type PR 56112 Content-Language: en-US From: =?UTF-8?Q?Fran=c3=a7ois_Dumont?= To: "libstdc++@gcc.gnu.org" References: <2fe3937d-1b9a-a547-bb41-225d3d5426a2@gmail.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.1 required=5.0 tests=BAYES_00, BODY_8BITS, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, KAM_NUMSUBJECT, NICE_REPLY_A, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Wed, 11 May 2022 17:04:06 -0000 Gentle reminder ! On 05/05/22 19:37, François Dumont wrote: > Hi > > Renewing my patch to fix PR 56112 but for the insert methods, I > totally change it, now works also with move-only key types. > > I let you Jonathan find a better name than _ValueTypeEnforcer as usual > :-) > > libstdc++: [_Hashtable] Insert range of types convertible to > value_type PR 56112 > > Fix insertion of range of types convertible to value_type. Fix also > when this value_type > has a move-only key_type which also allow converted values to be moved. > > libstdc++-v3/ChangeLog: > >         PR libstdc++/56112 >         * include/bits/hashtable_policy.h (_ValueTypeEnforcer): New. >         * include/bits/hashtable.h > (_Hashtable<>::_M_insert_unique_aux): New. >         (_Hashtable<>::_M_insert(_Arg&&, const _NodeGenerator&, > true_type)): Use latters. >         (_Hashtable<>::_M_insert(_Arg&&, const _NodeGenerator&, > false_type)): Likewise. >         (_Hashtable(_InputIterator, _InputIterator, size_type, const > _Hash&, const _Equal&, >         const allocator_type&, true_type)): Use this.insert range. >         (_Hashtable(_InputIterator, _InputIterator, size_type, const > _Hash&, const _Equal&, >         const allocator_type&, false_type)): Use _M_insert. >         * testsuite/23_containers/unordered_map/cons/56112.cc: Check > how many times conversion >         is done. >         (test02): New test case. >         * testsuite/23_containers/unordered_set/cons/56112.cc: New test. > > Tested under Linux x86_64. > > Ok to commit ? > > François >