[{"id":3680397,"web_url":"http://patchwork.ozlabs.org/comment/3680397/","msgid":"<bmm.h2v488uum8.gcc.gcc-TEST.redi.9.43.REVIEW@forge-stage.sourceware.org>","list_archive_url":null,"date":"2024-12-19T09:19:38","subject":"Re: [PATCH v1 0/3] libstdc++: Implement C++23 <flat_map> and\n <flat_set>","submitter":{"id":93210,"url":"http://patchwork.ozlabs.org/api/people/93210/","name":"Jonathan Wakely via Sourceware Forge","email":"forge-bot+redi@forge-stage.sourceware.org"},"content":"Jonathan Wakely (redi) <redi@gcc.gnu.org> requested changes to the code:\nSome quick comments on the tests. I'm still reviewing the implementations.\n\n> +++ libstdc++-v3/testsuite/23_containers/flat_map/1.cc\n> @@ -0,0 +116,4 @@\n> +int\n> +main()\n> +{\n> +  test01<std::vector>();\nMissing `#include <vector>` for this (I know it's included by your `<flat_map>` but it isn't necessarily required to be by the standard).\n\n> +++ libstdc++-v3/testsuite/23_containers/flat_multimap/1.cc\n> @@ -0,0 +99,4 @@\n> +int\n> +main()\n> +{\n> +  test01<std::vector>();\nMissing `#include <vector>`\n\n> +++ libstdc++-v3/testsuite/23_containers/flat_set/1.cc\n> @@ -0,0 +104,4 @@\n> +int\n> +main()\n> +{\n> +  test01<std::vector>();\nMissing `#include <vector>`\n\n> +++ libstdc++-v3/testsuite/23_containers/flat_set/1.cc\n> @@ -0,0 +31,4 @@\n> +      m.insert(m.end(), 0);\n> +      m.insert(m.end(), 1);\n> +      m.insert(m.end(), 2);\n> +      m.insert(m.end(), 3);\nIt might be better to insert these in a different order, to be confident they're being sorted correctly and not just preserving the order you inserted them.\n\nMaybe do:\n```\n      m.insert(m.end(), (0+i) % 4);\n      m.insert(m.end(), (1+i) % 4);\n      m.insert(m.end(), (2+i) % 4);\n      m.insert(m.end(), (3+i) % 4);\n```\nso they're inserted in a different order each time round the loop.\n\nYou could do the same for `flat_map/1.cc` too.\n\n> +++ libstdc++-v3/testsuite/23_containers/flat_set/1.cc\n> @@ -0,0 +31,4 @@\n> +      m.insert(m.end(), 0);\n> +      m.insert(m.end(), 1);\n> +      m.insert(m.end(), 2);\n> +      m.insert(m.end(), 3);\nFixed\n\n> +++ libstdc++-v3/testsuite/23_containers/flat_set/1.cc\n> @@ -0,0 +4,4 @@\n> +#include <deque>\n> +#include <testsuite_hooks.h>\n> +\n> +#if __cpp_lib_flat_set != 202207L\nI like to check the feature test macro after including the main header only, so put the includes for deque and testsuite_hooks.h (and vector) after checking the macro. That way we know it was set by flat_set not one of the others (even if the thing that's testing for is unlikely to ever be a problem, giving how our macros are implemented now).\n\nSame comment for the macro check in `flat_map/1.cc`\n\n\n--\nhttps://forge.sourceware.org/gcc/gcc-TEST/pulls/9#issuecomment-296","headers":{"Return-Path":"<gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org>","X-Original-To":["incoming@patchwork.ozlabs.org","gcc-patches@gcc.gnu.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","gcc-patches@gcc.gnu.org"],"Authentication-Results":["legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=2620:52:6:3111::32; helo=vm01.sourceware.org;\n envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org;\n receiver=patchwork.ozlabs.org)","sourceware.org; dmarc=none (p=none dis=none)\n header.from=forge-stage.sourceware.org","sourceware.org;\n spf=pass smtp.mailfrom=forge-stage.sourceware.org","server2.sourceware.org;\n arc=none smtp.remote-ip=38.145.34.39"],"Received":["from vm01.sourceware.org (vm01.sourceware.org\n [IPv6:2620:52:6:3111::32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g0w9t4CjTz1y2d\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 20:16:34 +1000 (AEST)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 9C23B4B9DB64\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 10:16:32 +0000 (GMT)","from forge-stage.sourceware.org (vm08.sourceware.org [38.145.34.39])\n by sourceware.org (Postfix) with ESMTPS id 2AAA54BA23F4\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 10:16:02 +0000 (GMT)","from forge-stage.sourceware.org (localhost [IPv6:::1])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256)\n (No client certificate requested)\n by forge-stage.sourceware.org (Postfix) with ESMTPS id 0583B40553\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 10:16:02 +0000 (UTC)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org 9C23B4B9DB64","OpenDKIM Filter v2.11.0 sourceware.org 2AAA54BA23F4"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org 2AAA54BA23F4","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org 2AAA54BA23F4","ARC-Seal":"i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776852962; cv=none;\n b=ocAg3TvkzmcUWQsa72tdEymkSGvYKgJ+KmBCrXo8fUC7uDGkJCVqRNVDxH+wSq6gPqDH4mcr72GdgFHI5hOtEsL3SRXm8DCJvJxlDPljl8SVrbqA6fhCJgGOCo73hhi6OMsi0WQXSwtOpnvF+Q2aT9MV3QD0JDAXoki5wgxsb34=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1776852962; c=relaxed/simple;\n bh=f0ZY555O1Zk5h0NVk2f1bbiXwE6yfEOnoXqDh+DSEuU=;\n h=Subject:From:To:Date:Message-ID:MIME-Version;\n b=Mg7SRTCnCc/tC9/AHc/OqMvpeIEsC88i1d0lDd5YGqGXEmmdfJvDd/1ePYgLcsIzvTLPFI061aGGdvSVZjLJVformhJ9U8KGITzx1uax0o7mr7+WPqo14pCC9MQPW/PN152+uYnMddbpnqNIjuOvzaau04kt11OV68phQQ1UCzk=","ARC-Authentication-Results":"i=1; server2.sourceware.org","Subject":"Re: [PATCH v1 0/3] libstdc++: Implement C++23 <flat_map> and\n <flat_set>","From":"Jonathan Wakely via Sourceware Forge\n <forge-bot+redi@forge-stage.sourceware.org>","To":"gcc-patches mailing list <gcc-patches@gcc.gnu.org>","Date":"Thu, 19 Dec 2024 09:19:38 +0000","Message-ID":"\n <bmm.h2v488uum8.gcc.gcc-TEST.redi.9.43.REVIEW@forge-stage.sourceware.org>","In-Reply-To":"\n <bmm.hhuay3vzv6.gcc.gcc-TEST.ppalka.9.1.0@forge-stage.sourceware.org>","X-Mailer":"batrachomyomachia","X-Requested-Reviewer":"redi","X-Pull-Request-Organization":"gcc","X-Pull-Request-Repository":"gcc-TEST","X-Pull-Request":"https://forge.sourceware.org/gcc/gcc-TEST/pulls/9","X-Review":"https://forge.sourceware.org/gcc/gcc-TEST/pulls/9#issuecomment-296","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"quoted-printable","MIME-Version":"1.0","X-BeenThere":"gcc-patches@gcc.gnu.org","X-Mailman-Version":"2.1.30","Precedence":"list","List-Id":"Gcc-patches mailing list <gcc-patches.gcc.gnu.org>","List-Unsubscribe":"<https://gcc.gnu.org/mailman/options/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe>","List-Archive":"<https://gcc.gnu.org/pipermail/gcc-patches/>","List-Post":"<mailto:gcc-patches@gcc.gnu.org>","List-Help":"<mailto:gcc-patches-request@gcc.gnu.org?subject=help>","List-Subscribe":"<https://gcc.gnu.org/mailman/listinfo/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe>","Errors-To":"gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org"}},{"id":3680399,"web_url":"http://patchwork.ozlabs.org/comment/3680399/","msgid":"<bmm.h1n18gc7k0.gcc.gcc-TEST.redi.9.46.REVIEW@forge-stage.sourceware.org>","list_archive_url":null,"date":"2024-11-09T09:43:57","subject":"Re: [PATCH v1 0/3] libstdc++: Implement C++23 <flat_map> and\n <flat_set>","submitter":{"id":93210,"url":"http://patchwork.ozlabs.org/api/people/93210/","name":"Jonathan Wakely via Sourceware Forge","email":"forge-bot+redi@forge-stage.sourceware.org"},"content":"Jonathan Wakely (redi) <redi@gcc.gnu.org>) commented on the code:\n\n\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +41,4 @@\n> +#include <compare>\n> +#include <initializer_list>\n> +\n> +#include <algorithm>\nDo we need the whole of `<algorithm>`, `<functional>`, and `<ranges>`?\n\nPlease add `<bits/uses_allocator_args.h>` so that if we do trim the includes down later, we still explicitly include it for `make_obj_using_allocator`.\n\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +41,4 @@\n> +#include <compare>\n> +#include <initializer_list>\n> +\n> +#include <algorithm>\nIndeed we can replace `<algorithm>` with `<bits/stl_algo.h>` and `<bits/ranges_algo.h>`.\n\n`<flat_map>` needs `<ranges>` for `views::zip`, but `<flat_set>` doesn't need `<ranges>` at all, so we can at least remove it from the latter header.\n\nBoth headers need `<functional>` for `std::not_fn`.\n\nAdded explicit `<bits/uses_allocator_args.h>`.\n\n\n--\nhttps://forge.sourceware.org/gcc/gcc-TEST/pulls/9#issuecomment-302","headers":{"Return-Path":"<gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org>","X-Original-To":["incoming@patchwork.ozlabs.org","gcc-patches@gcc.gnu.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","gcc-patches@gcc.gnu.org"],"Authentication-Results":["legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=38.145.34.32; helo=vm01.sourceware.org;\n envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org;\n receiver=patchwork.ozlabs.org)","sourceware.org; dmarc=none (p=none dis=none)\n header.from=forge-stage.sourceware.org","sourceware.org;\n spf=pass smtp.mailfrom=forge-stage.sourceware.org","server2.sourceware.org;\n arc=none smtp.remote-ip=38.145.34.39"],"Received":["from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g0wCH004Tz1y2d\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 20:17:46 +1000 (AEST)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id C20EB4BA901D\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 10:17:44 +0000 (GMT)","from forge-stage.sourceware.org (vm08.sourceware.org [38.145.34.39])\n by sourceware.org (Postfix) with ESMTPS id 713DE4BAD152\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 10:16:02 +0000 (GMT)","from forge-stage.sourceware.org (localhost [IPv6:::1])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256)\n (No client certificate requested)\n by forge-stage.sourceware.org (Postfix) with ESMTPS id 472B640558\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 10:16:02 +0000 (UTC)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org C20EB4BA901D","OpenDKIM Filter v2.11.0 sourceware.org 713DE4BAD152"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org 713DE4BAD152","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org 713DE4BAD152","ARC-Seal":"i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776852962; cv=none;\n b=JVEOlnIBQ8RxNAAPLR32ejkXPTCbl9CMXgVmcEL8JlSAwGYSFkRskmxMxhUWBiBQgUlzhFUyQUXUNQVj+n1+1VxQrQtuz+0wiqzxst9OslQ0ggnRaApFJ7qPIhynxgH7RK/+GCRLtJyQ4HWRlH9T93keidMvpJh5m07TR6Q/jVk=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1776852962; c=relaxed/simple;\n bh=flZzGR2UNkyLz5lp0DHdVzPQniS4limzwwO/WTRqunc=;\n h=Subject:From:To:Date:Message-ID:MIME-Version;\n b=I5BAS5Kx5GHE+M6X+FzAPXIHPH++0rqRvDUKR1TNHtBmZyPr1JM9GoyJfe4rpaIuC8YGyIfgkiy3r1y+0z0c6HR5DB9lGGuxE1KT9HBpBwe0C+KZMpiRnt8HisnXZzCdy0vqMKznJPNrv1STpPvPZtCOhljzGP64wqOBCFgkUFc=","ARC-Authentication-Results":"i=1; server2.sourceware.org","Subject":"Re: [PATCH v1 0/3] libstdc++: Implement C++23 <flat_map> and\n <flat_set>","From":"Jonathan Wakely via Sourceware Forge\n <forge-bot+redi@forge-stage.sourceware.org>","To":"gcc-patches mailing list <gcc-patches@gcc.gnu.org>","Date":"Sat, 09 Nov 2024 09:43:57 +0000","Message-ID":"\n <bmm.h1n18gc7k0.gcc.gcc-TEST.redi.9.46.REVIEW@forge-stage.sourceware.org>","In-Reply-To":"\n <bmm.hhuay3vzv6.gcc.gcc-TEST.ppalka.9.1.0@forge-stage.sourceware.org>","X-Mailer":"batrachomyomachia","X-Requested-Reviewer":"redi","X-Pull-Request-Organization":"gcc","X-Pull-Request-Repository":"gcc-TEST","X-Pull-Request":"https://forge.sourceware.org/gcc/gcc-TEST/pulls/9","X-Review":"https://forge.sourceware.org/gcc/gcc-TEST/pulls/9#issuecomment-302","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"quoted-printable","MIME-Version":"1.0","X-BeenThere":"gcc-patches@gcc.gnu.org","X-Mailman-Version":"2.1.30","Precedence":"list","List-Id":"Gcc-patches mailing list <gcc-patches.gcc.gnu.org>","List-Unsubscribe":"<https://gcc.gnu.org/mailman/options/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe>","List-Archive":"<https://gcc.gnu.org/pipermail/gcc-patches/>","List-Post":"<mailto:gcc-patches@gcc.gnu.org>","List-Help":"<mailto:gcc-patches-request@gcc.gnu.org?subject=help>","List-Subscribe":"<https://gcc.gnu.org/mailman/listinfo/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe>","Errors-To":"gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org"}},{"id":3680400,"web_url":"http://patchwork.ozlabs.org/comment/3680400/","msgid":"<bmm.h1n2g3j4zk.gcc.gcc-TEST.redi.9.48.REVIEW@forge-stage.sourceware.org>","list_archive_url":null,"date":"2024-11-09T10:27:56","subject":"Re: [PATCH v1 0/3] libstdc++: Implement C++23 <flat_map> and\n <flat_set>","submitter":{"id":93210,"url":"http://patchwork.ozlabs.org/api/people/93210/","name":"Jonathan Wakely via Sourceware Forge","email":"forge-bot+redi@forge-stage.sourceware.org"},"content":"Jonathan Wakely (redi) <redi@gcc.gnu.org>) commented on the code:\n\n\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +406,4 @@\n> +\t\t{\n> +\t\t  if (__s == 0) // hint[0] < k\n> +\t\t    // Insert before the leftmost equivalent key.\n> +\t\t    __key_it = std::lower_bound(__first, __last, __k, _M_comp);\nCan this be `lower_bound(__hint, __last, __k, _M_comp)`?\n\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +406,4 @@\n> +\t\t{\n> +\t\t  if (__s == 0) // hint[0] < k\n> +\t\t    // Insert before the leftmost equivalent key.\n> +\t\t    __key_it = std::lower_bound(__first, __last, __k, _M_comp);\nmaybe also have a branch for the `s == 1` case and use `lower_bound(__first, __hint, __k, _M_comp)`?\n\nI haven't checked if that actually works (e.g. if the hint is already in the middle of a group of keys equivalent to k), just seems at first glance like `s != -1` means we've already partitioned the range into [first, hint) and [hint,last) and don't need to bisect the whole of [first,last) again.\n\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +406,4 @@\n> +\t\t{\n> +\t\t  if (__s == 0) // hint[0] < k\n> +\t\t    // Insert before the leftmost equivalent key.\n> +\t\t    __key_it = std::lower_bound(__first, __last, __k, _M_comp);\n> just seems at first glance like s != -1 means we've already partitioned the range into [first, hint) and [hint,last) and don't need to bisect the whole of [first,last) again.\n\nIndeed, that's the intent of the code just before that block (which considers `__r` instead of `__s` but the formulations should be equivalent since `__r != -1` iff `__s != -1 && __hint->_M_index != 0`(?)).\n\n```cpp\nif (__r == 1) // k >= hint[-1]\n  __first += __hint->_M_index;\nelse if (__r == 0) // k < __hint[-1]\n  __last = __first + __hint->_M_index;\n```\n \n For `flat_map` this should be purely an optimization but for `flat_multimap` it's also a correctness issue (at least the `__r == 1` case is) since we need to insert the given key immediately before `__hint` and there could be multiple keys equivalent to `__hint`.\n\n\n--\nhttps://forge.sourceware.org/gcc/gcc-TEST/pulls/9#issuecomment-306","headers":{"Return-Path":"<gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org>","X-Original-To":["incoming@patchwork.ozlabs.org","gcc-patches@gcc.gnu.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","gcc-patches@gcc.gnu.org"],"Authentication-Results":["legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=38.145.34.32; helo=vm01.sourceware.org;\n envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org;\n receiver=patchwork.ozlabs.org)","sourceware.org; dmarc=none (p=none dis=none)\n header.from=forge-stage.sourceware.org","sourceware.org;\n spf=pass smtp.mailfrom=forge-stage.sourceware.org","server2.sourceware.org;\n arc=none smtp.remote-ip=38.145.34.39"],"Received":["from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g0wCJ59PJz1y2d\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 20:17:48 +1000 (AEST)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id B681D4B9DB5D\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 10:17:46 +0000 (GMT)","from forge-stage.sourceware.org (vm08.sourceware.org [38.145.34.39])\n by sourceware.org (Postfix) with ESMTPS id 14DA54B9DB4F\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 10:16:06 +0000 (GMT)","from forge-stage.sourceware.org (localhost [IPv6:::1])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256)\n (No client certificate requested)\n by forge-stage.sourceware.org (Postfix) with ESMTPS id 7549D4055A\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 10:16:02 +0000 (UTC)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org B681D4B9DB5D","OpenDKIM Filter v2.11.0 sourceware.org 14DA54B9DB4F"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org 14DA54B9DB4F","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org 14DA54B9DB4F","ARC-Seal":"i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776852966; cv=none;\n b=OjIdd9uibe3A7KqKD3mgG0WSDMa9QgcEimsA1GLb6wsY+pDrkgSrbS0wejBi+KKh68q5xImD92iFBbxAW84Jukum19YYN1gCq2MHUm6i70SchI44uDluxuvdCbJzD4o0il0tfPmZedZwpf243Y0vzkqbbH69vt4dGTLzss2Fw60=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1776852966; c=relaxed/simple;\n bh=VjdxXKHG5S/7ChEsn3xIlwHFqIrMzRiuN6K5XlBFNJc=;\n h=Subject:From:To:Date:Message-ID:MIME-Version;\n b=glncVcjdoRWuYW9KL3Yg2F0oFTDPOaadYazRGJGyp+Qmg3lRmar9WLdht89FSpc1g3sJy329aA20t73/OEzmSqkQ1w4jw9mfta18KDmhZAReCldqLVT2cQb/oXv6jSl2zpOaGH2JhWt5DokLwECnpx1pxEjg/N4corWtJde+UOc=","ARC-Authentication-Results":"i=1; server2.sourceware.org","Subject":"Re: [PATCH v1 0/3] libstdc++: Implement C++23 <flat_map> and\n <flat_set>","From":"Jonathan Wakely via Sourceware Forge\n <forge-bot+redi@forge-stage.sourceware.org>","To":"gcc-patches mailing list <gcc-patches@gcc.gnu.org>","Date":"Sat, 09 Nov 2024 10:27:56 +0000","Message-ID":"\n <bmm.h1n2g3j4zk.gcc.gcc-TEST.redi.9.48.REVIEW@forge-stage.sourceware.org>","In-Reply-To":"\n <bmm.hhuay3vzv6.gcc.gcc-TEST.ppalka.9.1.0@forge-stage.sourceware.org>","X-Mailer":"batrachomyomachia","X-Requested-Reviewer":"redi","X-Pull-Request-Organization":"gcc","X-Pull-Request-Repository":"gcc-TEST","X-Pull-Request":"https://forge.sourceware.org/gcc/gcc-TEST/pulls/9","X-Review":"https://forge.sourceware.org/gcc/gcc-TEST/pulls/9#issuecomment-306","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"quoted-printable","MIME-Version":"1.0","X-BeenThere":"gcc-patches@gcc.gnu.org","X-Mailman-Version":"2.1.30","Precedence":"list","List-Id":"Gcc-patches mailing list <gcc-patches.gcc.gnu.org>","List-Unsubscribe":"<https://gcc.gnu.org/mailman/options/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe>","List-Archive":"<https://gcc.gnu.org/pipermail/gcc-patches/>","List-Post":"<mailto:gcc-patches@gcc.gnu.org>","List-Help":"<mailto:gcc-patches-request@gcc.gnu.org?subject=help>","List-Subscribe":"<https://gcc.gnu.org/mailman/listinfo/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe>","Errors-To":"gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org"}},{"id":3680401,"web_url":"http://patchwork.ozlabs.org/comment/3680401/","msgid":"<bmm.h1n43i45xc.gcc.gcc-TEST.redi.9.57.REVIEW@forge-stage.sourceware.org>","list_archive_url":null,"date":"2024-11-09T11:27:48","subject":"Re: [PATCH v1 0/3] libstdc++: Implement C++23 <flat_map> and\n <flat_set>","submitter":{"id":93210,"url":"http://patchwork.ozlabs.org/api/people/93210/","name":"Jonathan Wakely via Sourceware Forge","email":"forge-bot+redi@forge-stage.sourceware.org"},"content":"Jonathan Wakely (redi) <redi@gcc.gnu.org>) commented on the code:\n\n\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +630,4 @@\n> +\n> +      value_compare\n> +      value_comp() const\n> +      { return value_compare(key_comp()); }\ncould use `_M_comp` instead of `key_comp()` to save a call.\n\n\n--\nhttps://forge.sourceware.org/gcc/gcc-TEST/pulls/9#issuecomment-327","headers":{"Return-Path":"<gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org>","X-Original-To":["incoming@patchwork.ozlabs.org","gcc-patches@gcc.gnu.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","gcc-patches@gcc.gnu.org"],"Authentication-Results":["legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=38.145.34.32; helo=vm01.sourceware.org;\n envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org;\n receiver=patchwork.ozlabs.org)","sourceware.org; dmarc=none (p=none dis=none)\n header.from=forge-stage.sourceware.org","sourceware.org;\n spf=pass smtp.mailfrom=forge-stage.sourceware.org","server2.sourceware.org;\n arc=none smtp.remote-ip=38.145.34.39"],"Received":["from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g0wCM6FLhz1y2d\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 20:17:51 +1000 (AEST)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 0EF984BAD159\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 10:17:50 +0000 (GMT)","from forge-stage.sourceware.org (vm08.sourceware.org [38.145.34.39])\n by sourceware.org (Postfix) with ESMTPS id 643874B9DB64\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 10:16:07 +0000 (GMT)","from forge-stage.sourceware.org (localhost [IPv6:::1])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256)\n (No client certificate requested)\n by forge-stage.sourceware.org (Postfix) with ESMTPS id 438F340564\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 10:16:03 +0000 (UTC)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org 0EF984BAD159","OpenDKIM Filter v2.11.0 sourceware.org 643874B9DB64"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org 643874B9DB64","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org 643874B9DB64","ARC-Seal":"i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776852967; cv=none;\n b=ncb4wyFeH7T8KLfuiuKhg70rN232+Z00KXtPGt+74RBPiybuFRKkzH8i8iAdNXn4jLwo3veR+9gKSFqwad0Ei/87L7haqsZ4urfaZQZ+BNJ7lPauUDMGTsPx37Ms/6+kaNj8mWUTWAx815060maEOJL7QHCf00LINm4fKpl6o/0=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1776852967; c=relaxed/simple;\n bh=gnb6oP063gcpS5pMXypCCMZTbtmEZ7lX0WNXJiTo2eY=;\n h=Subject:From:To:Date:Message-ID:MIME-Version;\n b=CVswwtyr0u7cIOkZZ8dVUMJ5Fad8WxNMwPeZ6CK0TibqwynNVykbYiNTNnnkUTKXLCAguP+MppIxsZBST71GkbhACnlCq8sO1Vp+P6x/C+VkSdB6DyDDEgix5lPuB9mURc/vOR5lr2nk82aBouCEPeZuB1MyHj6dZBWPVrq4ww4=","ARC-Authentication-Results":"i=1; server2.sourceware.org","Subject":"Re: [PATCH v1 0/3] libstdc++: Implement C++23 <flat_map> and\n <flat_set>","From":"Jonathan Wakely via Sourceware Forge\n <forge-bot+redi@forge-stage.sourceware.org>","To":"gcc-patches mailing list <gcc-patches@gcc.gnu.org>","Date":"Sat, 09 Nov 2024 11:27:48 +0000","Message-ID":"\n <bmm.h1n43i45xc.gcc.gcc-TEST.redi.9.57.REVIEW@forge-stage.sourceware.org>","In-Reply-To":"\n <bmm.hhuay3vzv6.gcc.gcc-TEST.ppalka.9.1.0@forge-stage.sourceware.org>","X-Mailer":"batrachomyomachia","X-Requested-Reviewer":"redi","X-Pull-Request-Organization":"gcc","X-Pull-Request-Repository":"gcc-TEST","X-Pull-Request":"https://forge.sourceware.org/gcc/gcc-TEST/pulls/9","X-Review":"https://forge.sourceware.org/gcc/gcc-TEST/pulls/9#issuecomment-327","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"7bit","MIME-Version":"1.0","X-BeenThere":"gcc-patches@gcc.gnu.org","X-Mailman-Version":"2.1.30","Precedence":"list","List-Id":"Gcc-patches mailing list <gcc-patches.gcc.gnu.org>","List-Unsubscribe":"<https://gcc.gnu.org/mailman/options/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe>","List-Archive":"<https://gcc.gnu.org/pipermail/gcc-patches/>","List-Post":"<mailto:gcc-patches@gcc.gnu.org>","List-Help":"<mailto:gcc-patches-request@gcc.gnu.org?subject=help>","List-Subscribe":"<https://gcc.gnu.org/mailman/listinfo/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe>","Errors-To":"gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org"}},{"id":3680402,"web_url":"http://patchwork.ozlabs.org/comment/3680402/","msgid":"<bmm.h1n1542ncw.gcc.gcc-TEST.redi.9.45.REVIEW@forge-stage.sourceware.org>","list_archive_url":null,"date":"2024-11-09T09:40:35","subject":"Re: [PATCH v1 0/3] libstdc++: Implement C++23 <flat_map> and\n <flat_set>","submitter":{"id":93210,"url":"http://patchwork.ozlabs.org/api/people/93210/","name":"Jonathan Wakely via Sourceware Forge","email":"forge-bot+redi@forge-stage.sourceware.org"},"content":"Jonathan Wakely (redi) <redi@gcc.gnu.org>) commented on the code:\n\n\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +147,4 @@\n> +      { __glibcxx_assert(_M_cont.keys.size() == _M_cont.values.size()); }\n> +\n> +      template<typename _InputIterator,\n> +\t       typename = _RequireInputIter<_InputIterator>>\nUse a _requires-clause_ instead? (Similarly below)\n\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +147,4 @@\n> +      { __glibcxx_assert(_M_cont.keys.size() == _M_cont.values.size()); }\n> +\n> +      template<typename _InputIterator,\n> +\t       typename = _RequireInputIter<_InputIterator>>\nRewrote those constraints with\n\n`requires requires { typename _RequireInputIter<_InputIterator>; }`\n\nI guess we might want to factor this out into a suitably-named concept at some point.\n\nI also rewrote `_RequireNotAllocator<_Compare>` constraints in the deduction guides accordingly.\n\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +147,4 @@\n> +      { __glibcxx_assert(_M_cont.keys.size() == _M_cont.values.size()); }\n> +\n> +      template<typename _InputIterator,\n> +\t       typename = _RequireInputIter<_InputIterator>>\nI ended up defining new `__not_allocator_like` and `__has_input_iter_cat` concepts to get rid of all `typename = ...`-style constraints.\n\n\n--\nhttps://forge.sourceware.org/gcc/gcc-TEST/pulls/9#issuecomment-300","headers":{"Return-Path":"<gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org>","X-Original-To":["incoming@patchwork.ozlabs.org","gcc-patches@gcc.gnu.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","gcc-patches@gcc.gnu.org"],"Authentication-Results":["legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=2620:52:6:3111::32; helo=vm01.sourceware.org;\n envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org;\n receiver=patchwork.ozlabs.org)","sourceware.org; dmarc=none (p=none dis=none)\n header.from=forge-stage.sourceware.org","sourceware.org;\n spf=pass smtp.mailfrom=forge-stage.sourceware.org","server2.sourceware.org;\n arc=none smtp.remote-ip=38.145.34.39"],"Received":["from vm01.sourceware.org (vm01.sourceware.org\n [IPv6:2620:52:6:3111::32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g0wCr5MC0z1y2d\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 20:18:16 +1000 (AEST)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id E20524BAD15E\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 10:18:14 +0000 (GMT)","from forge-stage.sourceware.org (vm08.sourceware.org [38.145.34.39])\n by sourceware.org (Postfix) with ESMTPS id 5E5AF4BAD14E\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 10:16:02 +0000 (GMT)","from forge-stage.sourceware.org (localhost [IPv6:::1])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256)\n (No client certificate requested)\n by forge-stage.sourceware.org (Postfix) with ESMTPS id 31E8240557\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 10:16:02 +0000 (UTC)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org E20524BAD15E","OpenDKIM Filter v2.11.0 sourceware.org 5E5AF4BAD14E"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org 5E5AF4BAD14E","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org 5E5AF4BAD14E","ARC-Seal":"i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776852962; cv=none;\n b=V4EWyzCVktw4/BeesMjKw1PPaazM25blffg3HibyHII8RB/Y91Bq/ynFuQgCR+cATgn/jxg0XHyQqbSRDlcWj/A5jSw0fXqNKqzE4F0E+N25ccf3XH2uCS8qGiZBHtEwcA0kMcRRB7SfV0ZUUhfnc/7PVhldD9pmfmjCgm7DdmE=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1776852962; c=relaxed/simple;\n bh=1JZfrM30BUJwCc3coTpRl0WaWNi5xtt44YkbgNkuxd0=;\n h=Subject:From:To:Date:Message-ID:MIME-Version;\n b=n24VY5Jj0bgIsqrEeBgUxREiIypN5+0EcfFYQL8PteLx0IN64FXFDNEx7Nfsxw8uaVvGUbd8v8ms89itl2Jv6oVKd2/lar7rZLaHRR9X386VToR4wHcQcNNDtGwyfVmFQ9xRQB6MHW40n46g/bbk85DR+7KY/4V92JG2in/w96M=","ARC-Authentication-Results":"i=1; server2.sourceware.org","Subject":"Re: [PATCH v1 0/3] libstdc++: Implement C++23 <flat_map> and\n <flat_set>","From":"Jonathan Wakely via Sourceware Forge\n <forge-bot+redi@forge-stage.sourceware.org>","To":"gcc-patches mailing list <gcc-patches@gcc.gnu.org>","Date":"Sat, 09 Nov 2024 09:40:35 +0000","Message-ID":"\n <bmm.h1n1542ncw.gcc.gcc-TEST.redi.9.45.REVIEW@forge-stage.sourceware.org>","In-Reply-To":"\n <bmm.hhuay3vzv6.gcc.gcc-TEST.ppalka.9.1.0@forge-stage.sourceware.org>","X-Mailer":"batrachomyomachia","X-Requested-Reviewer":"redi","X-Pull-Request-Organization":"gcc","X-Pull-Request-Repository":"gcc-TEST","X-Pull-Request":"https://forge.sourceware.org/gcc/gcc-TEST/pulls/9","X-Review":"https://forge.sourceware.org/gcc/gcc-TEST/pulls/9#issuecomment-300","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"quoted-printable","MIME-Version":"1.0","X-BeenThere":"gcc-patches@gcc.gnu.org","X-Mailman-Version":"2.1.30","Precedence":"list","List-Id":"Gcc-patches mailing list <gcc-patches.gcc.gnu.org>","List-Unsubscribe":"<https://gcc.gnu.org/mailman/options/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe>","List-Archive":"<https://gcc.gnu.org/pipermail/gcc-patches/>","List-Post":"<mailto:gcc-patches@gcc.gnu.org>","List-Help":"<mailto:gcc-patches-request@gcc.gnu.org?subject=help>","List-Subscribe":"<https://gcc.gnu.org/mailman/listinfo/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe>","Errors-To":"gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org"}},{"id":3680403,"web_url":"http://patchwork.ozlabs.org/comment/3680403/","msgid":"<bmm.h1n12kzbsw.gcc.gcc-TEST.redi.9.44.REVIEW@forge-stage.sourceware.org>","list_archive_url":null,"date":"2024-11-09T09:38:02","subject":"Re: [PATCH v1 0/3] libstdc++: Implement C++23 <flat_map> and\n <flat_set>","submitter":{"id":93210,"url":"http://patchwork.ozlabs.org/api/people/93210/","name":"Jonathan Wakely via Sourceware Forge","email":"forge-bot+redi@forge-stage.sourceware.org"},"content":"Jonathan Wakely (redi) <redi@gcc.gnu.org>) commented on the code:\n\n\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +144,4 @@\n> +\t\t     mapped_container_type __mapped_cont,\n> +\t\t     const key_compare& __comp = key_compare())\n> +      : _M_cont(std::move(__key_cont), std::move(__mapped_cont)), _M_comp(__comp)\n> +      { __glibcxx_assert(_M_cont.keys.size() == _M_cont.values.size()); }\nMaybe a debug mode check for the invariant?\n```\n_GLIBCXX_DEBUG_ASSERT(ranges::is_sorted(_M_cont.keys, _M_comp));\n```\n\n\n\n--\nhttps://forge.sourceware.org/gcc/gcc-TEST/pulls/9#issuecomment-298","headers":{"Return-Path":"<gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org>","X-Original-To":["incoming@patchwork.ozlabs.org","gcc-patches@gcc.gnu.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","gcc-patches@gcc.gnu.org"],"Authentication-Results":["legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=38.145.34.32; helo=vm01.sourceware.org;\n envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org;\n receiver=patchwork.ozlabs.org)","sourceware.org; dmarc=none (p=none dis=none)\n header.from=forge-stage.sourceware.org","sourceware.org;\n spf=pass smtp.mailfrom=forge-stage.sourceware.org","server2.sourceware.org;\n arc=none smtp.remote-ip=38.145.34.39"],"Received":["from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g0wDn2GT1z1y2d\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 20:19:03 +1000 (AEST)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 9ED4C4BAD165\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 10:19:01 +0000 (GMT)","from forge-stage.sourceware.org (vm08.sourceware.org [38.145.34.39])\n by sourceware.org (Postfix) with ESMTPS id 48A904BAD150\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 10:16:02 +0000 (GMT)","from forge-stage.sourceware.org (localhost [IPv6:::1])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256)\n (No client certificate requested)\n by forge-stage.sourceware.org (Postfix) with ESMTPS id 1D61340554\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 10:16:02 +0000 (UTC)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org 9ED4C4BAD165","OpenDKIM Filter v2.11.0 sourceware.org 48A904BAD150"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org 48A904BAD150","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org 48A904BAD150","ARC-Seal":"i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776852962; cv=none;\n b=J+uFF9YYeJim7WpDX8Rot2a9E3haQGZERlgFSyh5v2NRLKgkJ3Pae4PTqrCTXkWL3AmV16P0qt6N6Zdz6vMOE0JQyQXK1oagPhqFcUxfnluvZ/gvVZtTD2lfS91OZitKH8NbF46ZTjR3zbOPzNTelKzXRvjM69skpvOqaWX1viQ=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1776852962; c=relaxed/simple;\n bh=9p8WmM5mDtGF75A3W3dU7JgB+LW0q3XRXtfc/IJWJMQ=;\n h=Subject:From:To:Date:Message-ID:MIME-Version;\n b=NqUGEmveIMJguNMi3f0wAvpV7JaEtMATN9K6mv/fOZMofUHzqLAOZDl3G0YPTsk//5lczehDtjDTE8l8yIOFt9TQr2HngFHOsLibF6wDa2wYUVu3/jrTvwgTe0hkfC7X3PtGKB9IB2fUt3i+y9iExjMY3P+sIe/WW0sh1gWHLv0=","ARC-Authentication-Results":"i=1; server2.sourceware.org","Subject":"Re: [PATCH v1 0/3] libstdc++: Implement C++23 <flat_map> and\n <flat_set>","From":"Jonathan Wakely via Sourceware Forge\n <forge-bot+redi@forge-stage.sourceware.org>","To":"gcc-patches mailing list <gcc-patches@gcc.gnu.org>","Date":"Sat, 09 Nov 2024 09:38:02 +0000","Message-ID":"\n <bmm.h1n12kzbsw.gcc.gcc-TEST.redi.9.44.REVIEW@forge-stage.sourceware.org>","In-Reply-To":"\n <bmm.hhuay3vzv6.gcc.gcc-TEST.ppalka.9.1.0@forge-stage.sourceware.org>","X-Mailer":"batrachomyomachia","X-Requested-Reviewer":"redi","X-Pull-Request-Organization":"gcc","X-Pull-Request-Repository":"gcc-TEST","X-Pull-Request":"https://forge.sourceware.org/gcc/gcc-TEST/pulls/9","X-Review":"https://forge.sourceware.org/gcc/gcc-TEST/pulls/9#issuecomment-298","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"quoted-printable","MIME-Version":"1.0","X-BeenThere":"gcc-patches@gcc.gnu.org","X-Mailman-Version":"2.1.30","Precedence":"list","List-Id":"Gcc-patches mailing list <gcc-patches.gcc.gnu.org>","List-Unsubscribe":"<https://gcc.gnu.org/mailman/options/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe>","List-Archive":"<https://gcc.gnu.org/pipermail/gcc-patches/>","List-Post":"<mailto:gcc-patches@gcc.gnu.org>","List-Help":"<mailto:gcc-patches-request@gcc.gnu.org?subject=help>","List-Subscribe":"<https://gcc.gnu.org/mailman/listinfo/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe>","Errors-To":"gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org"}},{"id":3680404,"web_url":"http://patchwork.ozlabs.org/comment/3680404/","msgid":"<bmm.h1n3fme8e8.gcc.gcc-TEST.redi.9.51.REVIEW@forge-stage.sourceware.org>","list_archive_url":null,"date":"2024-11-09T11:03:44","subject":"Re: [PATCH v1 0/3] libstdc++: Implement C++23 <flat_map> and\n <flat_set>","submitter":{"id":93210,"url":"http://patchwork.ozlabs.org/api/people/93210/","name":"Jonathan Wakely via Sourceware Forge","email":"forge-bot+redi@forge-stage.sourceware.org"},"content":"Jonathan Wakely (redi) <redi@gcc.gnu.org>) commented on the code:\n\n\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +378,4 @@\n> +      // modifiers\n> +      template<typename _Key2, typename... _Args>\n> +\tpair<iterator, bool>\n> +\t_M_try_emplace(optional<const_iterator> __hint, _Key2&& __k, _Args&&... __args)\nI'm not wild about using `optional` for the hint, as `optional` is sadly quite computationally expensive (although a bit better since 9ed070220ec1c837149f7b2eff7227f2e6b503e3). But only having a single function to implement all insertion operations does simplify things... if it meets all the requirements.\n\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +378,4 @@\n> +      // modifiers\n> +      template<typename _Key2, typename... _Args>\n> +\tpair<iterator, bool>\n> +\t_M_try_emplace(optional<const_iterator> __hint, _Key2&& __k, _Args&&... __args)\nI tried to replace the use of `optional` here but couldn't arrive at anything I was happy with unfortunately\n\n\n--\nhttps://forge.sourceware.org/gcc/gcc-TEST/pulls/9#issuecomment-314","headers":{"Return-Path":"<gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org>","X-Original-To":["incoming@patchwork.ozlabs.org","gcc-patches@gcc.gnu.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","gcc-patches@gcc.gnu.org"],"Authentication-Results":["legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=38.145.34.32; helo=vm01.sourceware.org;\n envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org;\n receiver=patchwork.ozlabs.org)","sourceware.org; dmarc=none (p=none dis=none)\n header.from=forge-stage.sourceware.org","sourceware.org;\n spf=pass smtp.mailfrom=forge-stage.sourceware.org","server2.sourceware.org;\n arc=none smtp.remote-ip=38.145.34.39"],"Received":["from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g0wDp1Fvrz1yHB\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 20:19:06 +1000 (AEST)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 20BF74B9DB6E\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 10:19:04 +0000 (GMT)","from forge-stage.sourceware.org (vm08.sourceware.org [38.145.34.39])\n by sourceware.org (Postfix) with ESMTPS id 321F34B9DB5E\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 10:16:06 +0000 (GMT)","from forge-stage.sourceware.org (localhost [IPv6:::1])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256)\n (No client certificate requested)\n by forge-stage.sourceware.org (Postfix) with ESMTPS id B816E4055D\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 10:16:02 +0000 (UTC)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org 20BF74B9DB6E","OpenDKIM Filter v2.11.0 sourceware.org 321F34B9DB5E"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org 321F34B9DB5E","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org 321F34B9DB5E","ARC-Seal":"i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776852966; cv=none;\n b=NRcMoDPAqJew+u+t6UWhJxOF97mU2l3T8R9F9RpujlFXzp92cUTXG7JABcU7QPXZZH9WODFcZlQiMlTJP/hksC4R9sk2GssVgpSdZSJZGL5FVYdD+NjX3wNulJtBp01eq6qXoupxckNBlEic0f092KGNH1FEEfrnY8Har1qmYSo=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1776852966; c=relaxed/simple;\n bh=I+BVVQeiiTupFjpKnb+Fuvegzb10Z4onv7Zw133tIEc=;\n h=Subject:From:To:Date:Message-ID:MIME-Version;\n b=tbyfVXGqSjXdBAQOPP9Km5+9alDs/Oo6Q0W49ASpDLb15Iz4T1CAIgiLYQzYY4vEhOM5rvYNv/xm0QYUCEvUO+swNaitSqof2290HNQMbJOj8BU556y2x7NPz/tBqaWtn9lPCt2J3xlp6zd49rOia+2QH+xRHYC2sPjaXQPIjjk=","ARC-Authentication-Results":"i=1; server2.sourceware.org","Subject":"Re: [PATCH v1 0/3] libstdc++: Implement C++23 <flat_map> and\n <flat_set>","From":"Jonathan Wakely via Sourceware Forge\n <forge-bot+redi@forge-stage.sourceware.org>","To":"gcc-patches mailing list <gcc-patches@gcc.gnu.org>","Date":"Sat, 09 Nov 2024 11:03:44 +0000","Message-ID":"\n <bmm.h1n3fme8e8.gcc.gcc-TEST.redi.9.51.REVIEW@forge-stage.sourceware.org>","In-Reply-To":"\n <bmm.hhuay3vzv6.gcc.gcc-TEST.ppalka.9.1.0@forge-stage.sourceware.org>","X-Mailer":"batrachomyomachia","X-Requested-Reviewer":"redi","X-Pull-Request-Organization":"gcc","X-Pull-Request-Repository":"gcc-TEST","X-Pull-Request":"https://forge.sourceware.org/gcc/gcc-TEST/pulls/9","X-Review":"https://forge.sourceware.org/gcc/gcc-TEST/pulls/9#issuecomment-314","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"quoted-printable","MIME-Version":"1.0","X-BeenThere":"gcc-patches@gcc.gnu.org","X-Mailman-Version":"2.1.30","Precedence":"list","List-Id":"Gcc-patches mailing list <gcc-patches.gcc.gnu.org>","List-Unsubscribe":"<https://gcc.gnu.org/mailman/options/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe>","List-Archive":"<https://gcc.gnu.org/pipermail/gcc-patches/>","List-Post":"<mailto:gcc-patches@gcc.gnu.org>","List-Help":"<mailto:gcc-patches-request@gcc.gnu.org?subject=help>","List-Subscribe":"<https://gcc.gnu.org/mailman/listinfo/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe>","Errors-To":"gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org"}},{"id":3680405,"web_url":"http://patchwork.ozlabs.org/comment/3680405/","msgid":"<bmm.h1n4kgywlc.gcc.gcc-TEST.redi.9.63.REVIEW@forge-stage.sourceware.org>","list_archive_url":null,"date":"2024-11-09T11:44:54","subject":"Re: [PATCH v1 0/3] libstdc++: Implement C++23 <flat_map> and\n <flat_set>","submitter":{"id":93210,"url":"http://patchwork.ozlabs.org/api/people/93210/","name":"Jonathan Wakely via Sourceware Forge","email":"forge-bot+redi@forge-stage.sourceware.org"},"content":"Jonathan Wakely (redi) <redi@gcc.gnu.org>) commented on the code:\n\n\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +881,4 @@\n> +\n> +      reference\n> +      operator*() const noexcept\n> +      { return {_M_cont->keys[_M_index], _M_cont->values[_M_index]}; }\n`__glibcxx_assert(_M_index < _M_cont.size());`\n\n\n--\nhttps://forge.sourceware.org/gcc/gcc-TEST/pulls/9#issuecomment-339","headers":{"Return-Path":"<gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org>","X-Original-To":["incoming@patchwork.ozlabs.org","gcc-patches@gcc.gnu.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","gcc-patches@gcc.gnu.org"],"Authentication-Results":["legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=38.145.34.32; helo=vm01.sourceware.org;\n envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org;\n receiver=patchwork.ozlabs.org)","sourceware.org; dmarc=none (p=none dis=none)\n header.from=forge-stage.sourceware.org","sourceware.org;\n spf=pass smtp.mailfrom=forge-stage.sourceware.org","server2.sourceware.org;\n arc=none smtp.remote-ip=38.145.34.39"],"Received":["from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g0wDr5bK9z1y2d\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 20:19:08 +1000 (AEST)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 9EEBA4BAD166\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 10:19:06 +0000 (GMT)","from forge-stage.sourceware.org (vm08.sourceware.org [38.145.34.39])\n by sourceware.org (Postfix) with ESMTPS id 223254BAD154\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 10:16:11 +0000 (GMT)","from forge-stage.sourceware.org (localhost [IPv6:::1])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256)\n (No client certificate requested)\n by forge-stage.sourceware.org (Postfix) with ESMTPS id C1F794056A\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 10:16:03 +0000 (UTC)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org 9EEBA4BAD166","OpenDKIM Filter v2.11.0 sourceware.org 223254BAD154"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org 223254BAD154","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org 223254BAD154","ARC-Seal":"i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776852971; cv=none;\n b=YVavlTuSS6KyAaSX0i8hdchlIx5TQZndn+JJzWOiDyueELsYSmfgdGAK621QfOnuA5oQgHpfllS6urI1KK9kcGZFhES8DIgiXmc31Hq2e1n5qY52FfP+lo9+idJA1zQBSIUCivYA2Mz9HX19ntW626h1bu0x7POFgqP5AFz7laM=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1776852971; c=relaxed/simple;\n bh=ixuGiAVIz1Ip7V+FSMjAlDbng6Kyd333TdyQubv39DM=;\n h=Subject:From:To:Date:Message-ID:MIME-Version;\n b=K1N1VC5W5cRLCbvCGsmIhf5irGMm1Obwj04EIcXlB6uPVsrMPtE1GmVvoHe5tEhFMvJG7BlSbinXdnW7PtdM1ZCpWZjHmARuHxNgTxxBGHCHNvWI+W0DWaKf8s9IUp9jJOkN+JzYu7RN+ALr7oTSDQpAtbDBbp7ZQSy+iedZD60=","ARC-Authentication-Results":"i=1; server2.sourceware.org","Subject":"Re: [PATCH v1 0/3] libstdc++: Implement C++23 <flat_map> and\n <flat_set>","From":"Jonathan Wakely via Sourceware Forge\n <forge-bot+redi@forge-stage.sourceware.org>","To":"gcc-patches mailing list <gcc-patches@gcc.gnu.org>","Date":"Sat, 09 Nov 2024 11:44:54 +0000","Message-ID":"\n <bmm.h1n4kgywlc.gcc.gcc-TEST.redi.9.63.REVIEW@forge-stage.sourceware.org>","In-Reply-To":"\n <bmm.hhuay3vzv6.gcc.gcc-TEST.ppalka.9.1.0@forge-stage.sourceware.org>","X-Mailer":"batrachomyomachia","X-Requested-Reviewer":"redi","X-Pull-Request-Organization":"gcc","X-Pull-Request-Repository":"gcc-TEST","X-Pull-Request":"https://forge.sourceware.org/gcc/gcc-TEST/pulls/9","X-Review":"https://forge.sourceware.org/gcc/gcc-TEST/pulls/9#issuecomment-339","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"7bit","MIME-Version":"1.0","X-BeenThere":"gcc-patches@gcc.gnu.org","X-Mailman-Version":"2.1.30","Precedence":"list","List-Id":"Gcc-patches mailing list <gcc-patches.gcc.gnu.org>","List-Unsubscribe":"<https://gcc.gnu.org/mailman/options/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe>","List-Archive":"<https://gcc.gnu.org/pipermail/gcc-patches/>","List-Post":"<mailto:gcc-patches@gcc.gnu.org>","List-Help":"<mailto:gcc-patches-request@gcc.gnu.org?subject=help>","List-Subscribe":"<https://gcc.gnu.org/mailman/listinfo/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe>","Errors-To":"gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org"}},{"id":3680407,"web_url":"http://patchwork.ozlabs.org/comment/3680407/","msgid":"<bmm.h1n3yxsiyo.gcc.gcc-TEST.redi.9.56.REVIEW@forge-stage.sourceware.org>","list_archive_url":null,"date":"2024-11-09T11:23:12","subject":"Re: [PATCH v1 0/3] libstdc++: Implement C++23 <flat_map> and\n <flat_set>","submitter":{"id":93210,"url":"http://patchwork.ozlabs.org/api/people/93210/","name":"Jonathan Wakely via Sourceware Forge","email":"forge-bot+redi@forge-stage.sourceware.org"},"content":"Jonathan Wakely (redi) <redi@gcc.gnu.org>) commented on the code:\n\n\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +613,4 @@\n> +      {\n> +\tusing std::swap;\n> +\tswap(_M_cont, __x._M_cont);\n> +\tswap(_M_comp, __x._M_comp);\nThis doesn't swap `_M_comp`. At least we don't need to worry about exceptions, because it's `noexcept`!\n\nThe spec says to use `ranges::swap(keys, __x.keys)` and `ranges::swap(values, y.values)`, I don't remember why. \n\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +613,4 @@\n> +      {\n> +\tusing std::swap;\n> +\tswap(_M_cont, __x._M_cont);\n> +\tswap(_M_comp, __x._M_comp);\nApparently I can't read, I thought this was swapping keys and then values, but it's swapping _M_cont and then _M_comp. Oops.\n\nBut I think that's wrong. `swap(cont, x.cont)` will use the generic `std::swap` that does move construction+assignments, which won't use any ADL swap for the container. Using `swap(cont.keys, x.cont.keys); swap(cont.values, x.cont.values);` will find custom swaps.\n\nI guess using `swap` unqualified after `using std::swap` is fine, because that's what `ranges::swap` would do (since these aren't arrays).\n\n\n\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +613,4 @@\n> +      {\n> +\tusing std::swap;\n> +\tswap(_M_cont, __x._M_cont);\n> +\tswap(_M_comp, __x._M_comp);\nFixed to just use `ranges::swap` here.\n\n\n--\nhttps://forge.sourceware.org/gcc/gcc-TEST/pulls/9#issuecomment-325","headers":{"Return-Path":"<gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org>","X-Original-To":["incoming@patchwork.ozlabs.org","gcc-patches@gcc.gnu.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","gcc-patches@gcc.gnu.org"],"Authentication-Results":["legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=2620:52:6:3111::32; helo=vm01.sourceware.org;\n envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org;\n receiver=patchwork.ozlabs.org)","sourceware.org; dmarc=none (p=none dis=none)\n header.from=forge-stage.sourceware.org","sourceware.org;\n spf=pass smtp.mailfrom=forge-stage.sourceware.org","server2.sourceware.org;\n arc=none smtp.remote-ip=38.145.34.39"],"Received":["from vm01.sourceware.org (vm01.sourceware.org\n [IPv6:2620:52:6:3111::32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g0wFJ5ddMz1y2d\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 20:19:32 +1000 (AEST)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id E8D664BAD14D\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 10:19:30 +0000 (GMT)","from forge-stage.sourceware.org (vm08.sourceware.org [38.145.34.39])\n by sourceware.org (Postfix) with ESMTPS id 625354B9DB59\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 10:16:07 +0000 (GMT)","from forge-stage.sourceware.org (localhost [IPv6:::1])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256)\n (No client certificate requested)\n by forge-stage.sourceware.org (Postfix) with ESMTPS id 2BB9440562\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 10:16:03 +0000 (UTC)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org E8D664BAD14D","OpenDKIM Filter v2.11.0 sourceware.org 625354B9DB59"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org 625354B9DB59","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org 625354B9DB59","ARC-Seal":"i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776852967; cv=none;\n b=Ed2GX/2fd2C6iKQrHtJTRr1dFZqyizFj5oiP9stZIzVC/I177ukobxlBqSww1f80VA4oOfM5w4FeoG5BQgRNP04KH7csYJcdWUN4YnmMwXdewVR4XVEBYsh0R8YzTphyn1ENm3xrrHvYjYvHdCx9aU/Wm6Lu1VpsZZOJoNxoYVY=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1776852967; c=relaxed/simple;\n bh=9AKaIw3bAyUPynz0tVl63U/0buZk6ashzc1K5J2X5aY=;\n h=Subject:From:To:Date:Message-ID:MIME-Version;\n b=QNJsdnVQFCnajhpEYmA/GOjrs9cM9C2nglpb0X7UL7RhImaYXEBEOJQV+6SQX67pi1gAsFKqqslG0N3iUKpF0pS+eCB7gT7UWax0QjlkMVCotFPuUD8FcqqzS+z1R8z/VAd+xCGu+V0Bzed/pnhb8wYGsdgEDrx0vBk/b7+GkoQ=","ARC-Authentication-Results":"i=1; server2.sourceware.org","Subject":"Re: [PATCH v1 0/3] libstdc++: Implement C++23 <flat_map> and\n <flat_set>","From":"Jonathan Wakely via Sourceware Forge\n <forge-bot+redi@forge-stage.sourceware.org>","To":"gcc-patches mailing list <gcc-patches@gcc.gnu.org>","Date":"Sat, 09 Nov 2024 11:23:12 +0000","Message-ID":"\n <bmm.h1n3yxsiyo.gcc.gcc-TEST.redi.9.56.REVIEW@forge-stage.sourceware.org>","In-Reply-To":"\n <bmm.hhuay3vzv6.gcc.gcc-TEST.ppalka.9.1.0@forge-stage.sourceware.org>","X-Mailer":"batrachomyomachia","X-Requested-Reviewer":"redi","X-Pull-Request-Organization":"gcc","X-Pull-Request-Repository":"gcc-TEST","X-Pull-Request":"https://forge.sourceware.org/gcc/gcc-TEST/pulls/9","X-Review":"https://forge.sourceware.org/gcc/gcc-TEST/pulls/9#issuecomment-325","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"quoted-printable","MIME-Version":"1.0","X-BeenThere":"gcc-patches@gcc.gnu.org","X-Mailman-Version":"2.1.30","Precedence":"list","List-Id":"Gcc-patches mailing list <gcc-patches.gcc.gnu.org>","List-Unsubscribe":"<https://gcc.gnu.org/mailman/options/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe>","List-Archive":"<https://gcc.gnu.org/pipermail/gcc-patches/>","List-Post":"<mailto:gcc-patches@gcc.gnu.org>","List-Help":"<mailto:gcc-patches-request@gcc.gnu.org?subject=help>","List-Subscribe":"<https://gcc.gnu.org/mailman/listinfo/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe>","Errors-To":"gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org"}},{"id":3680408,"web_url":"http://patchwork.ozlabs.org/comment/3680408/","msgid":"<bmm.h1n1khrry8.gcc.gcc-TEST.redi.9.47.REVIEW@forge-stage.sourceware.org>","list_archive_url":null,"date":"2024-11-09T09:56:05","subject":"Re: [PATCH v1 0/3] libstdc++: Implement C++23 <flat_map> and\n <flat_set>","submitter":{"id":93210,"url":"http://patchwork.ozlabs.org/api/people/93210/","name":"Jonathan Wakely via Sourceware Forge","email":"forge-bot+redi@forge-stage.sourceware.org"},"content":"Jonathan Wakely (redi) <redi@gcc.gnu.org>) commented on the code:\n\n\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +231,4 @@\n> +      template<typename _Alloc>\n> +\t_Flat_map_impl(const _Derived& __x, const _Alloc& __a)\n> +\t: _M_comp(__x._M_comp),\n> +\t  _M_cont(std::make_obj_using_allocator<containers>(__a, __x._M_cont))\nI don't think this will use uses-allocator construction. `containers` has no constructors, so `is_constructible_v<containers, const Alloc&>` is false, so it won't pass the allocator to the `keys` and `values` subobjects.\n\nI think you need to construct `_M_cont` using aggregate-initialization from two containers, each individually constructed with uses-allocator construction, similar to line 227.\n\nDitto for line 240, that won't use the allocator either.\n\nThis suggests missing tests for the allocator constructors. `<testsuite_allocator.h>` has `uneq_allocator` which has an integer \"personality\". You can use that to verify that the `keys` and `values` constructed here use the allocator passed to the constructor, rather than copying the ones from `__x`\n\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +231,4 @@\n> +      template<typename _Alloc>\n> +\t_Flat_map_impl(const _Derived& __x, const _Alloc& __a)\n> +\t: _M_comp(__x._M_comp),\n> +\t  _M_cont(std::make_obj_using_allocator<containers>(__a, __x._M_cont))\nD'oh, fixed and added tests for these allocator constructors (at least the non-delegating ones)\n\n\n--\nhttps://forge.sourceware.org/gcc/gcc-TEST/pulls/9#issuecomment-304","headers":{"Return-Path":"<gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org>","X-Original-To":["incoming@patchwork.ozlabs.org","gcc-patches@gcc.gnu.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","gcc-patches@gcc.gnu.org"],"Authentication-Results":["legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=38.145.34.32; helo=vm01.sourceware.org;\n envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org;\n receiver=patchwork.ozlabs.org)","sourceware.org; dmarc=none (p=none dis=none)\n header.from=forge-stage.sourceware.org","sourceware.org;\n spf=pass smtp.mailfrom=forge-stage.sourceware.org","server2.sourceware.org;\n arc=none smtp.remote-ip=38.145.34.39"],"Received":["from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g0wFW19Ylz1y2d\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 20:19:43 +1000 (AEST)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 3EEBD4BAD166\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 10:19:41 +0000 (GMT)","from forge-stage.sourceware.org (vm08.sourceware.org [38.145.34.39])\n by sourceware.org (Postfix) with ESMTPS id 959734BAD154\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 10:16:02 +0000 (GMT)","from forge-stage.sourceware.org (localhost [IPv6:::1])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256)\n (No client certificate requested)\n by forge-stage.sourceware.org (Postfix) with ESMTPS id 5FFDF40559\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 10:16:02 +0000 (UTC)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org 3EEBD4BAD166","OpenDKIM Filter v2.11.0 sourceware.org 959734BAD154"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org 959734BAD154","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org 959734BAD154","ARC-Seal":"i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776852962; cv=none;\n b=hQKrrR8SH4Gpn+kopYOQK4UiuSc4jAxSTKt7BoDHsAmbIOIzSu3JNnAVSUa1zfL3yOujRl9BBtuFi4xFRK5d11V2alCMD8ChkxIqW2WdPXeSjtYTekl80GMjrvBkkhMGcZYajYGv5DWwypo85mVHth4/5H3mxPefb4YvP9vxYFM=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1776852962; c=relaxed/simple;\n bh=FHT7cyvolPe9PnjzOA5ZpZ9Vgm21P3tiTXdZnCUcvPA=;\n h=Subject:From:To:Date:Message-ID:MIME-Version;\n b=Te4NFmp4txEPTCBV7n28USejxblDZ+sLzuMp0sAdedLWJbDBm48Vk2nAmuKEbbX3CIridUfiOEfO0YAnISAMQrm1AeoYYUGBKbBwq9b5Nxa/6mTNwSFYpf9KL827kiOfSWP5Zpot+6y7KaKk8Etj0GOvE/+MDVwTNKWw0nemFMA=","ARC-Authentication-Results":"i=1; server2.sourceware.org","Subject":"Re: [PATCH v1 0/3] libstdc++: Implement C++23 <flat_map> and\n <flat_set>","From":"Jonathan Wakely via Sourceware Forge\n <forge-bot+redi@forge-stage.sourceware.org>","To":"gcc-patches mailing list <gcc-patches@gcc.gnu.org>","Date":"Sat, 09 Nov 2024 09:56:05 +0000","Message-ID":"\n <bmm.h1n1khrry8.gcc.gcc-TEST.redi.9.47.REVIEW@forge-stage.sourceware.org>","In-Reply-To":"\n <bmm.hhuay3vzv6.gcc.gcc-TEST.ppalka.9.1.0@forge-stage.sourceware.org>","X-Mailer":"batrachomyomachia","X-Requested-Reviewer":"redi","X-Pull-Request-Organization":"gcc","X-Pull-Request-Repository":"gcc-TEST","X-Pull-Request":"https://forge.sourceware.org/gcc/gcc-TEST/pulls/9","X-Review":"https://forge.sourceware.org/gcc/gcc-TEST/pulls/9#issuecomment-304","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"quoted-printable","MIME-Version":"1.0","X-BeenThere":"gcc-patches@gcc.gnu.org","X-Mailman-Version":"2.1.30","Precedence":"list","List-Id":"Gcc-patches mailing list <gcc-patches.gcc.gnu.org>","List-Unsubscribe":"<https://gcc.gnu.org/mailman/options/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe>","List-Archive":"<https://gcc.gnu.org/pipermail/gcc-patches/>","List-Post":"<mailto:gcc-patches@gcc.gnu.org>","List-Help":"<mailto:gcc-patches-request@gcc.gnu.org?subject=help>","List-Subscribe":"<https://gcc.gnu.org/mailman/listinfo/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe>","Errors-To":"gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org"}},{"id":3680409,"web_url":"http://patchwork.ozlabs.org/comment/3680409/","msgid":"<bmm.h1n3s9uu68.gcc.gcc-TEST.redi.9.53.REVIEW@forge-stage.sourceware.org>","list_archive_url":null,"date":"2024-11-09T11:16:29","subject":"Re: [PATCH v1 0/3] libstdc++: Implement C++23 <flat_map> and\n <flat_set>","submitter":{"id":93210,"url":"http://patchwork.ozlabs.org/api/people/93210/","name":"Jonathan Wakely via Sourceware Forge","email":"forge-bot+redi@forge-stage.sourceware.org"},"content":"Jonathan Wakely (redi) <redi@gcc.gnu.org>) commented on the code:\n\n\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +552,4 @@\n> +      replace(key_container_type&& __key_cont, mapped_container_type&& __mapped_cont)\n> +      {\n> +\t__glibcxx_assert(__key_cont.size() == __mapped_cont.size());\n> +\t__try\nCan use the RAII guard here too.\n\n\n--\nhttps://forge.sourceware.org/gcc/gcc-TEST/pulls/9#issuecomment-319","headers":{"Return-Path":"<gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org>","X-Original-To":["incoming@patchwork.ozlabs.org","gcc-patches@gcc.gnu.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","gcc-patches@gcc.gnu.org"],"Authentication-Results":["legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=2620:52:6:3111::32; helo=vm01.sourceware.org;\n envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org;\n receiver=patchwork.ozlabs.org)","sourceware.org; dmarc=none (p=none dis=none)\n header.from=forge-stage.sourceware.org","sourceware.org;\n spf=pass smtp.mailfrom=forge-stage.sourceware.org","server2.sourceware.org;\n arc=none smtp.remote-ip=38.145.34.39"],"Received":["from vm01.sourceware.org (vm01.sourceware.org\n [IPv6:2620:52:6:3111::32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g0wGC38JTz1yD5\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 20:20:19 +1000 (AEST)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 990474BA902E\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 10:20:17 +0000 (GMT)","from forge-stage.sourceware.org (vm08.sourceware.org [38.145.34.39])\n by sourceware.org (Postfix) with ESMTPS id 4F7724BA23F3\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 10:16:06 +0000 (GMT)","from forge-stage.sourceware.org (localhost [IPv6:::1])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256)\n (No client certificate requested)\n by forge-stage.sourceware.org (Postfix) with ESMTPS id E1A484055F\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 10:16:02 +0000 (UTC)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org 990474BA902E","OpenDKIM Filter v2.11.0 sourceware.org 4F7724BA23F3"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org 4F7724BA23F3","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org 4F7724BA23F3","ARC-Seal":"i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776852966; cv=none;\n b=dbwB1DOP7DbY4oQ1e3/1YD0XpDZdXtgqkEuaIZlyH1HXAUeJlB5m/z66N/D6dmVLePLn+Jxau5ZNoiw3e9wMj/p7zWIqtXfw89Vl517+8vb3dVq7MyYbDtW8xPkFRuSrPf1GD4EIIWxFg/yTsS+ZEwLrf2NOKTVO8p4vNm8KZbo=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1776852966; c=relaxed/simple;\n bh=0SHR0OR264XV9lt2PkERvrhLWJyFfz8q0tcCdISwoo0=;\n h=Subject:From:To:Date:Message-ID:MIME-Version;\n b=bIZ3qhv3hP3+4dW8mmICWSVgG7fNvFNp0pLve4IwjovAB3yaL2dkqXrGfGrqtiYSuTAUEgIZ6sv49mm7XlXv5cfjGw9Tpa6IJfKwmA8iIzbzS9PDNlO/m2XZVM0aH9sod+myoipoc2C0zaqB2tCK/YyeFLSUDBEzSSX6P8iulo4=","ARC-Authentication-Results":"i=1; server2.sourceware.org","Subject":"Re: [PATCH v1 0/3] libstdc++: Implement C++23 <flat_map> and\n <flat_set>","From":"Jonathan Wakely via Sourceware Forge\n <forge-bot+redi@forge-stage.sourceware.org>","To":"gcc-patches mailing list <gcc-patches@gcc.gnu.org>","Date":"Sat, 09 Nov 2024 11:16:29 +0000","Message-ID":"\n <bmm.h1n3s9uu68.gcc.gcc-TEST.redi.9.53.REVIEW@forge-stage.sourceware.org>","In-Reply-To":"\n <bmm.hhuay3vzv6.gcc.gcc-TEST.ppalka.9.1.0@forge-stage.sourceware.org>","X-Mailer":"batrachomyomachia","X-Requested-Reviewer":"redi","X-Pull-Request-Organization":"gcc","X-Pull-Request-Repository":"gcc-TEST","X-Pull-Request":"https://forge.sourceware.org/gcc/gcc-TEST/pulls/9","X-Review":"https://forge.sourceware.org/gcc/gcc-TEST/pulls/9#issuecomment-319","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"quoted-printable","MIME-Version":"1.0","X-BeenThere":"gcc-patches@gcc.gnu.org","X-Mailman-Version":"2.1.30","Precedence":"list","List-Id":"Gcc-patches mailing list <gcc-patches.gcc.gnu.org>","List-Unsubscribe":"<https://gcc.gnu.org/mailman/options/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe>","List-Archive":"<https://gcc.gnu.org/pipermail/gcc-patches/>","List-Post":"<mailto:gcc-patches@gcc.gnu.org>","List-Help":"<mailto:gcc-patches-request@gcc.gnu.org?subject=help>","List-Subscribe":"<https://gcc.gnu.org/mailman/listinfo/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe>","Errors-To":"gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org"}},{"id":3680410,"web_url":"http://patchwork.ozlabs.org/comment/3680410/","msgid":"<bmm.h1n3qc74e8.gcc.gcc-TEST.redi.9.52.REVIEW@forge-stage.sourceware.org>","list_archive_url":null,"date":"2024-11-09T11:14:32","subject":"Re: [PATCH v1 0/3] libstdc++: Implement C++23 <flat_map> and\n <flat_set>","submitter":{"id":93210,"url":"http://patchwork.ozlabs.org/api/people/93210/","name":"Jonathan Wakely via Sourceware Forge","email":"forge-bot+redi@forge-stage.sourceware.org"},"content":"Jonathan Wakely (redi) <redi@gcc.gnu.org>) commented on the code:\n\n\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +512,4 @@\n> +\t      _M_cont.keys.emplace_back(std::move(__value.first));\n> +\t      _M_cont.values.emplace_back(std::move(__value.second));\n> +\t    }\n> +\t  _M_sort_uniq();\nWe need a try-catch around all this, otherwise any failed insertion into `values` leaves us with `keys.size() != values.size(), and a failed insertion into `keys` or an exception constructing `__value` leaves us unsorted.\n\nI think you probably want a really simple RAII guard type that is used in multiple places:\n\n```\nstruct _KillEmAll {\n  ~_KillEmAll() { if (_M_map) _M_map->clear(); }\n  _Flat_map_impl* _M_map;\n};\n```\n(better name TBD)\n\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +512,4 @@\n> +\t      _M_cont.keys.emplace_back(std::move(__value.first));\n> +\t      _M_cont.values.emplace_back(std::move(__value.second));\n> +\t    }\n> +\t  _M_sort_uniq();\nOh, exactly like you have on line 540. But it's needed in multiple places, so defined it at class scope.\n\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +512,4 @@\n> +\t      _M_cont.keys.emplace_back(std::move(__value.first));\n> +\t      _M_cont.values.emplace_back(std::move(__value.second));\n> +\t    }\n> +\t  _M_sort_uniq();\nShould now be fixed\n\n\n--\nhttps://forge.sourceware.org/gcc/gcc-TEST/pulls/9#issuecomment-316","headers":{"Return-Path":"<gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org>","X-Original-To":["incoming@patchwork.ozlabs.org","gcc-patches@gcc.gnu.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","gcc-patches@gcc.gnu.org"],"Authentication-Results":["legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=2620:52:6:3111::32; helo=vm01.sourceware.org;\n envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org;\n receiver=patchwork.ozlabs.org)","sourceware.org; dmarc=none (p=none dis=none)\n header.from=forge-stage.sourceware.org","sourceware.org;\n spf=pass smtp.mailfrom=forge-stage.sourceware.org","server2.sourceware.org;\n arc=none smtp.remote-ip=38.145.34.39"],"Received":["from vm01.sourceware.org (vm01.sourceware.org\n [IPv6:2620:52:6:3111::32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g0wGH1ndCz1yD5\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 20:20:23 +1000 (AEST)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 3D55B4BAE7D1\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 10:20:21 +0000 (GMT)","from forge-stage.sourceware.org (vm08.sourceware.org [38.145.34.39])\n by sourceware.org (Postfix) with ESMTPS id 3EFE24B9DB7D\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 10:16:06 +0000 (GMT)","from forge-stage.sourceware.org (localhost [IPv6:::1])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256)\n (No client certificate requested)\n by forge-stage.sourceware.org (Postfix) with ESMTPS id CE1164055E\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 10:16:02 +0000 (UTC)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org 3D55B4BAE7D1","OpenDKIM Filter v2.11.0 sourceware.org 3EFE24B9DB7D"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org 3EFE24B9DB7D","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org 3EFE24B9DB7D","ARC-Seal":"i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776852966; cv=none;\n b=AxZRu7vUJx1fU6PWpJtryHACl73GBXVSZaMxb6hiQ6Dl7+om0nXxuU6OSrzE9nbaFfZamRKqrwhu3dqkMn7AfP7LfuSw24oUPQasUKEM6jM5YkvacLXA4LOBttALiGkF7l1Km3zZ69BjGKeGU++kIp64lOox64KDq2vpq/kIdMs=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1776852966; c=relaxed/simple;\n bh=/Cl/cEqHb8pWxr6iVPclygoV3nySGTh8hwjMN2+nlzg=;\n h=Subject:From:To:Date:Message-ID:MIME-Version;\n b=w0EnOrZDQ/uu+FjuHZKogm2g11DKiWNGTcIpoX5uVfwGm5SWnYoIPVR50GUEm/D7aJPrhkj5r4OBbiCuYaIJCof4Vwx7dieIkm5o7e8yOduBV+M8imt4qVBTl0Nx8kp4cfmohxmCsYmX3jdkIKcQw8sy/QVY3P7dt6rMo4t7ssU=","ARC-Authentication-Results":"i=1; server2.sourceware.org","Subject":"Re: [PATCH v1 0/3] libstdc++: Implement C++23 <flat_map> and\n <flat_set>","From":"Jonathan Wakely via Sourceware Forge\n <forge-bot+redi@forge-stage.sourceware.org>","To":"gcc-patches mailing list <gcc-patches@gcc.gnu.org>","Date":"Sat, 09 Nov 2024 11:14:32 +0000","Message-ID":"\n <bmm.h1n3qc74e8.gcc.gcc-TEST.redi.9.52.REVIEW@forge-stage.sourceware.org>","In-Reply-To":"\n <bmm.hhuay3vzv6.gcc.gcc-TEST.ppalka.9.1.0@forge-stage.sourceware.org>","X-Mailer":"batrachomyomachia","X-Requested-Reviewer":"redi","X-Pull-Request-Organization":"gcc","X-Pull-Request-Repository":"gcc-TEST","X-Pull-Request":"https://forge.sourceware.org/gcc/gcc-TEST/pulls/9","X-Review":"https://forge.sourceware.org/gcc/gcc-TEST/pulls/9#issuecomment-316","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"quoted-printable","MIME-Version":"1.0","X-BeenThere":"gcc-patches@gcc.gnu.org","X-Mailman-Version":"2.1.30","Precedence":"list","List-Id":"Gcc-patches mailing list <gcc-patches.gcc.gnu.org>","List-Unsubscribe":"<https://gcc.gnu.org/mailman/options/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe>","List-Archive":"<https://gcc.gnu.org/pipermail/gcc-patches/>","List-Post":"<mailto:gcc-patches@gcc.gnu.org>","List-Help":"<mailto:gcc-patches-request@gcc.gnu.org?subject=help>","List-Subscribe":"<https://gcc.gnu.org/mailman/listinfo/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe>","Errors-To":"gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org"}},{"id":3680411,"web_url":"http://patchwork.ozlabs.org/comment/3680411/","msgid":"<bmm.h1n4t1dfy8.gcc.gcc-TEST.redi.9.65.REVIEW@forge-stage.sourceware.org>","list_archive_url":null,"date":"2024-11-09T11:53:32","subject":"Re: [PATCH v1 0/3] libstdc++: Implement C++23 <flat_map> and\n <flat_set>","submitter":{"id":93210,"url":"http://patchwork.ozlabs.org/api/people/93210/","name":"Jonathan Wakely via Sourceware Forge","email":"forge-bot+redi@forge-stage.sourceware.org"},"content":"Jonathan Wakely (redi) <redi@gcc.gnu.org>) commented on the code:\n\n\n> +++ libstdc++-v3/include/std/flat_set\n> @@ -0,0 +257,4 @@\n> +      operator=(initializer_list<value_type> __il)\n> +      {\n> +\tclear();\n> +\tinsert(__il);\nInstead of clear+insert I think you can just do `_M_cont = __il`, which is part of the general container requirements.\n\nFor some containers `clear()` deallocates all the storage and then `insert(il)` would have to reallocate, e.g. `deque`. But assigning the list directly can reuse existing elements.\n\n> +++ libstdc++-v3/include/std/flat_set\n> @@ -0,0 +257,4 @@\n> +      operator=(initializer_list<value_type> __il)\n> +      {\n> +\tclear();\n> +\tinsert(__il);\nSounds good.  In that case we need a clear guard, and call `_M_sort_uniq` afterwards since the initializer list elements aren't necessarily sorted/deduped IIUC.\n\n\n--\nhttps://forge.sourceware.org/gcc/gcc-TEST/pulls/9#issuecomment-342","headers":{"Return-Path":"<gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org>","X-Original-To":["incoming@patchwork.ozlabs.org","gcc-patches@gcc.gnu.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","gcc-patches@gcc.gnu.org"],"Authentication-Results":["legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=2620:52:6:3111::32; helo=vm01.sourceware.org;\n envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org;\n receiver=patchwork.ozlabs.org)","sourceware.org; dmarc=none (p=none dis=none)\n header.from=forge-stage.sourceware.org","sourceware.org;\n spf=pass smtp.mailfrom=forge-stage.sourceware.org","server2.sourceware.org;\n arc=none smtp.remote-ip=38.145.34.39"],"Received":["from vm01.sourceware.org (vm01.sourceware.org\n [IPv6:2620:52:6:3111::32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g0wGK1mrqz1yD5\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 20:20:25 +1000 (AEST)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 421964BB3B91\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 10:20:23 +0000 (GMT)","from forge-stage.sourceware.org (vm08.sourceware.org [38.145.34.39])\n by sourceware.org (Postfix) with ESMTPS id 5CBDF4BAD170\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 10:16:11 +0000 (GMT)","from forge-stage.sourceware.org (localhost [IPv6:::1])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256)\n (No client certificate requested)\n by forge-stage.sourceware.org (Postfix) with ESMTPS id EC79A4056C\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 10:16:03 +0000 (UTC)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org 421964BB3B91","OpenDKIM Filter v2.11.0 sourceware.org 5CBDF4BAD170"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org 5CBDF4BAD170","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org 5CBDF4BAD170","ARC-Seal":"i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776852971; cv=none;\n b=W520jLcnJQFL7+40k90/jdCkUIuW5jBy2ufcR4FiFKraTM1XqhEhhhH1PiL9niKDbn+F/WDT1vZ2KufDKmUr6tngM+dyPMyphHypLCyOVgXM51H3NCg1MoIrxNq9c7iV47xjmNgqZcFyUIFsPyFUOW8zQ6fGecxDZ+6vQQfQUig=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1776852971; c=relaxed/simple;\n bh=qNg2B7aGmUJHrutH0+uWPmh3N5WcBvdxCg3PTl90RFg=;\n h=Subject:From:To:Date:Message-ID:MIME-Version;\n b=mixwq5Xo/INtqAD6I9x5A98g0DCHp10D/O+mdrUd/VUmg9XK/WJ3mOlfioGMwtwcp5lXelTzXcmADz0aRbtH1UhcPERrzX7Scx5SdDmf2lVIrnivYg1m8vXmnPwHIejhYybM1UFRBTpVTrZ0Zf4PEvMDWwsaTRi446n2HMJAEGw=","ARC-Authentication-Results":"i=1; server2.sourceware.org","Subject":"Re: [PATCH v1 0/3] libstdc++: Implement C++23 <flat_map> and\n <flat_set>","From":"Jonathan Wakely via Sourceware Forge\n <forge-bot+redi@forge-stage.sourceware.org>","To":"gcc-patches mailing list <gcc-patches@gcc.gnu.org>","Date":"Sat, 09 Nov 2024 11:53:32 +0000","Message-ID":"\n <bmm.h1n4t1dfy8.gcc.gcc-TEST.redi.9.65.REVIEW@forge-stage.sourceware.org>","In-Reply-To":"\n <bmm.hhuay3vzv6.gcc.gcc-TEST.ppalka.9.1.0@forge-stage.sourceware.org>","X-Mailer":"batrachomyomachia","X-Requested-Reviewer":"redi","X-Pull-Request-Organization":"gcc","X-Pull-Request-Repository":"gcc-TEST","X-Pull-Request":"https://forge.sourceware.org/gcc/gcc-TEST/pulls/9","X-Review":"https://forge.sourceware.org/gcc/gcc-TEST/pulls/9#issuecomment-342","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"quoted-printable","MIME-Version":"1.0","X-BeenThere":"gcc-patches@gcc.gnu.org","X-Mailman-Version":"2.1.30","Precedence":"list","List-Id":"Gcc-patches mailing list <gcc-patches.gcc.gnu.org>","List-Unsubscribe":"<https://gcc.gnu.org/mailman/options/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe>","List-Archive":"<https://gcc.gnu.org/pipermail/gcc-patches/>","List-Post":"<mailto:gcc-patches@gcc.gnu.org>","List-Help":"<mailto:gcc-patches-request@gcc.gnu.org?subject=help>","List-Subscribe":"<https://gcc.gnu.org/mailman/listinfo/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe>","Errors-To":"gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org"}},{"id":3680412,"web_url":"http://patchwork.ozlabs.org/comment/3680412/","msgid":"<bmm.hhuazasyww.gcc.gcc-TEST.forge-bot.9.5513.CMT@forge-stage.sourceware.org>","list_archive_url":null,"date":"2026-04-22T10:15:59","subject":"Re: [PATCH v1 0/3] libstdc++: Implement C++23 <flat_map> and\n <flat_set>","submitter":{"id":93212,"url":"http://patchwork.ozlabs.org/api/people/93212/","name":"Lichenor Forgejo Bot via Sourceware Forge","email":"forge-bot+forge-bot@forge-stage.sourceware.org"},"content":"Sent patch series version 1 containing 3 patches to gcc-patches mailing list <gcc-patches@gcc.gnu.org>.\n[Cover letter](https://inbox.sourceware.org/gcc-patches/bmm.hhuay3vzv6.gcc.gcc-TEST.ppalka.9.1.0@forge-stage.sourceware.org)\n\n--\nhttps://forge.sourceware.org/gcc/gcc-TEST/pulls/9#issuecomment-5513","headers":{"Return-Path":"<gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org>","X-Original-To":["incoming@patchwork.ozlabs.org","gcc-patches@gcc.gnu.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","gcc-patches@gcc.gnu.org"],"Authentication-Results":["legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=2620:52:6:3111::32; helo=vm01.sourceware.org;\n envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org;\n receiver=patchwork.ozlabs.org)","sourceware.org; dmarc=none (p=none dis=none)\n header.from=forge-stage.sourceware.org","sourceware.org;\n spf=pass smtp.mailfrom=forge-stage.sourceware.org","server2.sourceware.org;\n arc=none smtp.remote-ip=38.145.34.39"],"Received":["from vm01.sourceware.org (vm01.sourceware.org\n [IPv6:2620:52:6:3111::32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g0wGm6kXKz1yD5\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 20:20:48 +1000 (AEST)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 22EA74BAE7E7\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 10:20:47 +0000 (GMT)","from forge-stage.sourceware.org (vm08.sourceware.org [38.145.34.39])\n by sourceware.org (Postfix) with ESMTPS id 622904BA903B\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 10:16:07 +0000 (GMT)","from forge-stage.sourceware.org (localhost [IPv6:::1])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256)\n (No client certificate requested)\n by forge-stage.sourceware.org (Postfix) with ESMTPS id 3A82D40563\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 10:16:03 +0000 (UTC)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org 22EA74BAE7E7","OpenDKIM Filter v2.11.0 sourceware.org 622904BA903B"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org 622904BA903B","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org 622904BA903B","ARC-Seal":"i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776852967; cv=none;\n b=fRll1ssuC8RAdQthrzvbIaa8MK4w22ZrM40xwtjesMMVrJoLoBVafLEuGeeWybj75URV1ZYE8iLnQ8eU5yg11lHxvVqCrlSRJZTPf1AHgkjHy+zMPEXf8JfpPZf0S38LWJA+FfeazyW1ehcQEGwI3ACo/5gKoAvp0K0/KRAnYws=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1776852967; c=relaxed/simple;\n bh=i7MVQaIOGKtegZZhUB3thbpRU7rcQ5+6EAx0BGSDkXo=;\n h=Subject:From:To:Date:Message-ID:MIME-Version;\n b=PuPLdBwmT8sMbtW/oOWbtnLn42Zd/6X/cIvqWD2WxnTWvjCx0g6laaNZuQOYi86Yo4u1RxyjO2UCyE+622IPFCQL0zN5DTJiBurzQnLDbhV/zzsLIqLmQrM72nHyrkKPSSJOWdJhzoZ1aLcB+tZgBNm6fwGqvDVRxGzXZ1sCzEo=","ARC-Authentication-Results":"i=1; server2.sourceware.org","Subject":"Re: [PATCH v1 0/3] libstdc++: Implement C++23 <flat_map> and\n <flat_set>","From":"Lichenor Forgejo Bot via Sourceware Forge\n <forge-bot+forge-bot@forge-stage.sourceware.org>","To":"gcc-patches mailing list <gcc-patches@gcc.gnu.org>","Date":"Wed, 22 Apr 2026 10:15:59 +0000","Message-ID":"\n <bmm.hhuazasyww.gcc.gcc-TEST.forge-bot.9.5513.CMT@forge-stage.sourceware.org>","In-Reply-To":"\n <bmm.hhuay3vzv6.gcc.gcc-TEST.ppalka.9.1.0@forge-stage.sourceware.org>","X-Mailer":"batrachomyomachia","X-Requested-Reviewer":"redi","X-Pull-Request-Organization":"gcc","X-Pull-Request-Repository":"gcc-TEST","X-Pull-Request":"https://forge.sourceware.org/gcc/gcc-TEST/pulls/9","X-Comment":"https://forge.sourceware.org/gcc/gcc-TEST/pulls/9#issuecomment-5513","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"quoted-printable","MIME-Version":"1.0","X-BeenThere":"gcc-patches@gcc.gnu.org","X-Mailman-Version":"2.1.30","Precedence":"list","List-Id":"Gcc-patches mailing list <gcc-patches.gcc.gnu.org>","List-Unsubscribe":"<https://gcc.gnu.org/mailman/options/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe>","List-Archive":"<https://gcc.gnu.org/pipermail/gcc-patches/>","List-Post":"<mailto:gcc-patches@gcc.gnu.org>","List-Help":"<mailto:gcc-patches-request@gcc.gnu.org?subject=help>","List-Subscribe":"<https://gcc.gnu.org/mailman/listinfo/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe>","Errors-To":"gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org"}},{"id":3680413,"web_url":"http://patchwork.ozlabs.org/comment/3680413/","msgid":"<bmm.h1n3bhjv5s.gcc.gcc-TEST.redi.9.50.REVIEW@forge-stage.sourceware.org>","list_archive_url":null,"date":"2024-11-09T10:59:34","subject":"Re: [PATCH v1 0/3] libstdc++: Implement C++23 <flat_map> and\n <flat_set>","submitter":{"id":93210,"url":"http://patchwork.ozlabs.org/api/people/93210/","name":"Jonathan Wakely via Sourceware Forge","email":"forge-bot+redi@forge-stage.sourceware.org"},"content":"Jonathan Wakely (redi) <redi@gcc.gnu.org>) commented on the code:\n\n\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +429,4 @@\n> +\t    }\n> +\t  __catch(...)\n> +\t    {\n> +\t      _M_cont.keys.erase(__key_it);\nIf inserting into `values` throws, it might now have a different number of elements to `keys`, e.g. it could have already inserted an element at the end and be in the process of rotating all the existing elements to put it in the correct place (a not-unreasonable implementation strategy for a user-defined sequence). If one of the swaps done by the rotation throws, then `values` is left with more elements than `keys`. We have to `clear()`, there's no other way to be sure the map's invariants hold.\n\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +429,4 @@\n> +\t    }\n> +\t  __catch(...)\n> +\t    {\n> +\t      _M_cont.keys.erase(__key_it);\nAha, should now be fixed by unconditionally clearing both containers upon exception in that code block.\n\n\n--\nhttps://forge.sourceware.org/gcc/gcc-TEST/pulls/9#issuecomment-312","headers":{"Return-Path":"<gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org>","X-Original-To":["incoming@patchwork.ozlabs.org","gcc-patches@gcc.gnu.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","gcc-patches@gcc.gnu.org"],"Authentication-Results":["legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=2620:52:6:3111::32; helo=vm01.sourceware.org;\n envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org;\n receiver=patchwork.ozlabs.org)","sourceware.org; dmarc=none (p=none dis=none)\n header.from=forge-stage.sourceware.org","sourceware.org;\n spf=pass smtp.mailfrom=forge-stage.sourceware.org","server2.sourceware.org;\n arc=none smtp.remote-ip=38.145.34.39"],"Received":["from vm01.sourceware.org (vm01.sourceware.org\n [IPv6:2620:52:6:3111::32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g0wH01FbGz1yD5\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 20:21:00 +1000 (AEST)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 2B9E44BB3BAF\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 10:20:58 +0000 (GMT)","from forge-stage.sourceware.org (vm08.sourceware.org [38.145.34.39])\n by sourceware.org (Postfix) with ESMTPS id 35EC74B9DB73\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 10:16:06 +0000 (GMT)","from forge-stage.sourceware.org (localhost [IPv6:::1])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256)\n (No client certificate requested)\n by forge-stage.sourceware.org (Postfix) with ESMTPS id A3B9D4055C\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 10:16:02 +0000 (UTC)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org 2B9E44BB3BAF","OpenDKIM Filter v2.11.0 sourceware.org 35EC74B9DB73"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org 35EC74B9DB73","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org 35EC74B9DB73","ARC-Seal":"i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776852966; cv=none;\n b=M/geF9amHGr4pqmHqmo1cn7I9boURq3uZUbAZPn2VhqXkAoL/CBCXDnvBCy0PmaxybK51scTtsEgzDNEftECt6SVx5JaYmFKxwzGNjbEH0V3yiYoxnAIeDl3AKed6lnGXKYGJzYapeLf0B8tdRRivb5pSACn1eDibMHMYTV+t10=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1776852966; c=relaxed/simple;\n bh=cy4/z3sM1CJCzuYhafpV2bUBP4A786Tr9TC3RsbLGeU=;\n h=Subject:From:To:Date:Message-ID:MIME-Version;\n b=jjFx/WE0E8qv2b0ReMc6G7YXFKqSn8NDMd0AJ29WFj5pEj4aHHk+lJtZRGcreDbPdb7iONPtl+Y7kYGqp4ovRN8WKXyr6Y2JJppBRAnuqma5ojIg2EqqMPNAIMcqJOVcCH/klSFFh6kiYwhKWv4IQ3U2d1G2/J0iUaLESFrsWFY=","ARC-Authentication-Results":"i=1; server2.sourceware.org","Subject":"Re: [PATCH v1 0/3] libstdc++: Implement C++23 <flat_map> and\n <flat_set>","From":"Jonathan Wakely via Sourceware Forge\n <forge-bot+redi@forge-stage.sourceware.org>","To":"gcc-patches mailing list <gcc-patches@gcc.gnu.org>","Date":"Sat, 09 Nov 2024 10:59:34 +0000","Message-ID":"\n <bmm.h1n3bhjv5s.gcc.gcc-TEST.redi.9.50.REVIEW@forge-stage.sourceware.org>","In-Reply-To":"\n <bmm.hhuay3vzv6.gcc.gcc-TEST.ppalka.9.1.0@forge-stage.sourceware.org>","X-Mailer":"batrachomyomachia","X-Requested-Reviewer":"redi","X-Pull-Request-Organization":"gcc","X-Pull-Request-Repository":"gcc-TEST","X-Pull-Request":"https://forge.sourceware.org/gcc/gcc-TEST/pulls/9","X-Review":"https://forge.sourceware.org/gcc/gcc-TEST/pulls/9#issuecomment-312","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"quoted-printable","MIME-Version":"1.0","X-BeenThere":"gcc-patches@gcc.gnu.org","X-Mailman-Version":"2.1.30","Precedence":"list","List-Id":"Gcc-patches mailing list <gcc-patches.gcc.gnu.org>","List-Unsubscribe":"<https://gcc.gnu.org/mailman/options/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe>","List-Archive":"<https://gcc.gnu.org/pipermail/gcc-patches/>","List-Post":"<mailto:gcc-patches@gcc.gnu.org>","List-Help":"<mailto:gcc-patches-request@gcc.gnu.org?subject=help>","List-Subscribe":"<https://gcc.gnu.org/mailman/listinfo/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe>","Errors-To":"gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org"}},{"id":3680414,"web_url":"http://patchwork.ozlabs.org/comment/3680414/","msgid":"<bmm.h1n48q9534.gcc.gcc-TEST.redi.9.59.REVIEW@forge-stage.sourceware.org>","list_archive_url":null,"date":"2024-11-09T11:33:04","subject":"Re: [PATCH v1 0/3] libstdc++: Implement C++23 <flat_map> and\n <flat_set>","submitter":{"id":93210,"url":"http://patchwork.ozlabs.org/api/people/93210/","name":"Jonathan Wakely via Sourceware Forge","email":"forge-bot+redi@forge-stage.sourceware.org"},"content":"Jonathan Wakely (redi) <redi@gcc.gnu.org>) commented on the code:\n\n\n\n--\nhttps://forge.sourceware.org/gcc/gcc-TEST/pulls/9#issuecomment-331","headers":{"Return-Path":"<gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org>","X-Original-To":["incoming@patchwork.ozlabs.org","gcc-patches@gcc.gnu.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","gcc-patches@gcc.gnu.org"],"Authentication-Results":["legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=2620:52:6:3111::32; helo=vm01.sourceware.org;\n envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org;\n receiver=patchwork.ozlabs.org)","sourceware.org; dmarc=none (p=none dis=none)\n header.from=forge-stage.sourceware.org","sourceware.org;\n spf=pass smtp.mailfrom=forge-stage.sourceware.org","server2.sourceware.org;\n arc=none smtp.remote-ip=38.145.34.39"],"Received":["from vm01.sourceware.org (vm01.sourceware.org\n [IPv6:2620:52:6:3111::32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g0wHg1JH3z1yD5\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 20:21:35 +1000 (AEST)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 238714BB3BCB\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 10:21:33 +0000 (GMT)","from forge-stage.sourceware.org (vm08.sourceware.org [38.145.34.39])\n by sourceware.org (Postfix) with ESMTPS id A277C4B9DB5D\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 10:16:07 +0000 (GMT)","from forge-stage.sourceware.org (localhost [IPv6:::1])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256)\n (No client certificate requested)\n by forge-stage.sourceware.org (Postfix) with ESMTPS id 7030B40566\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 10:16:03 +0000 (UTC)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org 238714BB3BCB","OpenDKIM Filter v2.11.0 sourceware.org A277C4B9DB5D"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org A277C4B9DB5D","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org A277C4B9DB5D","ARC-Seal":"i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776852967; cv=none;\n b=IM01UNZrWFT6747Mb6i/fnhKJmlBJtGD7AoVAf6Ll5fLVRTqnY9ZjXXngLyaE2JEnrZbZ+2SuSZii2LrXmVmzicRTVPk5QnshCeDVZHfZ8u3basVb52ThcO0FGQ7v3WLwIxZa1VxC8T6IVheF1a/P620WLz1cpGju8da51qTiUw=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1776852967; c=relaxed/simple;\n bh=M1zoosBG2ZU+M5104BHVUBWTyFEQRQ7PKjpGpdeKwIA=;\n h=Subject:From:To:Date:Message-ID:MIME-Version;\n b=S08LnZvWzEsh0us8stmTnpU4F8GcaRGA6PSI5No4PIE/XjIPcTDwSFPouj7bjbnQLIKt1n4elwvcrY0LsiPUJPhSatHd8HGvFxJJuWYtrzNbqrwb40D9+nDzbNiAH2Rd7McqT5iVCgi3aQA+08uwW69vqV8FHN6sS8d8lPHiYvk=","ARC-Authentication-Results":"i=1; server2.sourceware.org","Subject":"Re: [PATCH v1 0/3] libstdc++: Implement C++23 <flat_map> and\n <flat_set>","From":"Jonathan Wakely via Sourceware Forge\n <forge-bot+redi@forge-stage.sourceware.org>","To":"gcc-patches mailing list <gcc-patches@gcc.gnu.org>","Date":"Sat, 09 Nov 2024 11:33:04 +0000","Message-ID":"\n <bmm.h1n48q9534.gcc.gcc-TEST.redi.9.59.REVIEW@forge-stage.sourceware.org>","In-Reply-To":"\n <bmm.hhuay3vzv6.gcc.gcc-TEST.ppalka.9.1.0@forge-stage.sourceware.org>","X-Mailer":"batrachomyomachia","X-Requested-Reviewer":"redi","X-Pull-Request-Organization":"gcc","X-Pull-Request-Repository":"gcc-TEST","X-Pull-Request":"https://forge.sourceware.org/gcc/gcc-TEST/pulls/9","X-Review":"https://forge.sourceware.org/gcc/gcc-TEST/pulls/9#issuecomment-331","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"7bit","MIME-Version":"1.0","X-BeenThere":"gcc-patches@gcc.gnu.org","X-Mailman-Version":"2.1.30","Precedence":"list","List-Id":"Gcc-patches mailing list <gcc-patches.gcc.gnu.org>","List-Unsubscribe":"<https://gcc.gnu.org/mailman/options/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe>","List-Archive":"<https://gcc.gnu.org/pipermail/gcc-patches/>","List-Post":"<mailto:gcc-patches@gcc.gnu.org>","List-Help":"<mailto:gcc-patches-request@gcc.gnu.org?subject=help>","List-Subscribe":"<https://gcc.gnu.org/mailman/listinfo/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe>","Errors-To":"gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org"}},{"id":3680415,"web_url":"http://patchwork.ozlabs.org/comment/3680415/","msgid":"<bmm.h1n3tp2474.gcc.gcc-TEST.redi.9.54.REVIEW@forge-stage.sourceware.org>","list_archive_url":null,"date":"2024-11-09T11:17:55","subject":"Re: [PATCH v1 0/3] libstdc++: Implement C++23 <flat_map> and\n <flat_set>","submitter":{"id":93210,"url":"http://patchwork.ozlabs.org/api/people/93210/","name":"Jonathan Wakely via Sourceware Forge","email":"forge-bot+redi@forge-stage.sourceware.org"},"content":"Jonathan Wakely (redi) <redi@gcc.gnu.org>) commented on the code:\n\n\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +576,4 @@\n> +      {\n> +\tauto __idx = __position._M_index;\n> +\tauto __it = _M_cont.keys.erase(_M_cont.keys.begin() + __idx);\n> +\t_M_cont.values.erase(_M_cont.values.begin() + __idx);\nI think this has to clear() on an exception as well. Erasing from either container could throw while shuffling elements around, which would leave the relative number or order of elements inconsistent.\n\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +576,4 @@\n> +      {\n> +\tauto __idx = __position._M_index;\n> +\tauto __it = _M_cont.keys.erase(_M_cont.keys.begin() + __idx);\n> +\t_M_cont.values.erase(_M_cont.values.begin() + __idx);\nFixed\n\n\n--\nhttps://forge.sourceware.org/gcc/gcc-TEST/pulls/9#issuecomment-321","headers":{"Return-Path":"<gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org>","X-Original-To":["incoming@patchwork.ozlabs.org","gcc-patches@gcc.gnu.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","gcc-patches@gcc.gnu.org"],"Authentication-Results":["legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=2620:52:6:3111::32; helo=vm01.sourceware.org;\n envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org;\n receiver=patchwork.ozlabs.org)","sourceware.org; dmarc=none (p=none dis=none)\n header.from=forge-stage.sourceware.org","sourceware.org;\n spf=pass smtp.mailfrom=forge-stage.sourceware.org","server2.sourceware.org;\n arc=none smtp.remote-ip=38.145.34.39"],"Received":["from vm01.sourceware.org (vm01.sourceware.org\n [IPv6:2620:52:6:3111::32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g0wHl3vgxz1yD5\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 20:21:39 +1000 (AEST)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 40FED4BB3BA7\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 10:21:37 +0000 (GMT)","from forge-stage.sourceware.org (vm08.sourceware.org [38.145.34.39])\n by sourceware.org (Postfix) with ESMTPS id 3BEE54BAD15E\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 10:16:07 +0000 (GMT)","from forge-stage.sourceware.org (localhost [IPv6:::1])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256)\n (No client certificate requested)\n by forge-stage.sourceware.org (Postfix) with ESMTPS id 02FDF40560\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 10:16:03 +0000 (UTC)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org 40FED4BB3BA7","OpenDKIM Filter v2.11.0 sourceware.org 3BEE54BAD15E"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org 3BEE54BAD15E","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org 3BEE54BAD15E","ARC-Seal":"i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776852967; cv=none;\n b=jdNqGfxoT4+QGZ94Nx2BplfHSkJuwCbZpjOcsUu/NcENgJTtWDQ85rx85ZBnyM4KEyUajZPU1BfHIbiGSjdoMACwXB+tQ+KYqQ0f2RgpryAs0raZEd4Y/drU8kmLUdoNz3rItDH4hudHMVj6zqQqjKaImxx44oRI/GWYiPMbJZc=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1776852967; c=relaxed/simple;\n bh=Elxd9w96oZm9NdSa3JfqTUL/XogXMoeACF7Cd9DyGBQ=;\n h=Subject:From:To:Date:Message-ID:MIME-Version;\n b=e7L939UUM5hy7Bou+/tVYPjQCa9xBNrVVaosarwm7IcbFDmh37M1ZO9X3tAsGSFiQ0BxKjXco0pnqH3HPIAWCGtUvFCdmmq6S2qolkoWjxx+CXjZihsF+Cw7SKaUAFyfmJK89VtDP0HNPNKs9tEc5Sq8j+KOvuQF1idWlfGA2Xs=","ARC-Authentication-Results":"i=1; server2.sourceware.org","Subject":"Re: [PATCH v1 0/3] libstdc++: Implement C++23 <flat_map> and\n <flat_set>","From":"Jonathan Wakely via Sourceware Forge\n <forge-bot+redi@forge-stage.sourceware.org>","To":"gcc-patches mailing list <gcc-patches@gcc.gnu.org>","Date":"Sat, 09 Nov 2024 11:17:55 +0000","Message-ID":"\n <bmm.h1n3tp2474.gcc.gcc-TEST.redi.9.54.REVIEW@forge-stage.sourceware.org>","In-Reply-To":"\n <bmm.hhuay3vzv6.gcc.gcc-TEST.ppalka.9.1.0@forge-stage.sourceware.org>","X-Mailer":"batrachomyomachia","X-Requested-Reviewer":"redi","X-Pull-Request-Organization":"gcc","X-Pull-Request-Repository":"gcc-TEST","X-Pull-Request":"https://forge.sourceware.org/gcc/gcc-TEST/pulls/9","X-Review":"https://forge.sourceware.org/gcc/gcc-TEST/pulls/9#issuecomment-321","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"quoted-printable","MIME-Version":"1.0","X-BeenThere":"gcc-patches@gcc.gnu.org","X-Mailman-Version":"2.1.30","Precedence":"list","List-Id":"Gcc-patches mailing list <gcc-patches.gcc.gnu.org>","List-Unsubscribe":"<https://gcc.gnu.org/mailman/options/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe>","List-Archive":"<https://gcc.gnu.org/pipermail/gcc-patches/>","List-Post":"<mailto:gcc-patches@gcc.gnu.org>","List-Help":"<mailto:gcc-patches-request@gcc.gnu.org?subject=help>","List-Subscribe":"<https://gcc.gnu.org/mailman/listinfo/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe>","Errors-To":"gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org"}},{"id":3680416,"web_url":"http://patchwork.ozlabs.org/comment/3680416/","msgid":"<bmm.h2sn6puzuo.gcc.gcc-TEST.ppalka.9.525.CMT@forge-stage.sourceware.org>","list_archive_url":null,"date":"2024-12-17T03:29:12","subject":"Re: [PATCH v1 0/3] libstdc++: Implement C++23 <flat_map> and\n <flat_set>","submitter":{"id":93215,"url":"http://patchwork.ozlabs.org/api/people/93215/","name":"ppalka via Sourceware Forge","email":"forge-bot+ppalka@forge-stage.sourceware.org"},"content":"Updated with hopefully all review comments addressed.  The from_range_t constructors and guides are now also implemented.\n\n--\nhttps://forge.sourceware.org/gcc/gcc-TEST/pulls/9#issuecomment-525","headers":{"Return-Path":"<gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org>","X-Original-To":["incoming@patchwork.ozlabs.org","gcc-patches@gcc.gnu.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","gcc-patches@gcc.gnu.org"],"Authentication-Results":["legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=2620:52:6:3111::32; helo=vm01.sourceware.org;\n envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org;\n receiver=patchwork.ozlabs.org)","sourceware.org; dmarc=none (p=none dis=none)\n header.from=forge-stage.sourceware.org","sourceware.org;\n spf=pass smtp.mailfrom=forge-stage.sourceware.org","server2.sourceware.org;\n arc=none smtp.remote-ip=38.145.34.39"],"Received":["from vm01.sourceware.org (vm01.sourceware.org\n [IPv6:2620:52:6:3111::32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g0wHm6FZyz1yD5\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 20:21:40 +1000 (AEST)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id B9A2E4BB3B85\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 10:21:38 +0000 (GMT)","from forge-stage.sourceware.org (vm08.sourceware.org [38.145.34.39])\n by sourceware.org (Postfix) with ESMTPS id 5F1084BAD176\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 10:16:11 +0000 (GMT)","from forge-stage.sourceware.org (localhost [IPv6:::1])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256)\n (No client certificate requested)\n by forge-stage.sourceware.org (Postfix) with ESMTPS id 357A14056F\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 10:16:04 +0000 (UTC)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org B9A2E4BB3B85","OpenDKIM Filter v2.11.0 sourceware.org 5F1084BAD176"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org 5F1084BAD176","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org 5F1084BAD176","ARC-Seal":"i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776852971; cv=none;\n b=KXRqbNPuamPY4IRtFswp0RIprntfUGcUuu/Ce1EdohGq7bOgBL093wrIZPdWFJlW4ruLZYaAOt2owu4tVSqb2vW7IoRxdLadmoO5lEp/siO2hHemiQvhR9sC1uEzG404RcHyHvxAeR/owGFu7oddWJxggDfuEExVp9DIPzEWur8=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1776852971; c=relaxed/simple;\n bh=/dj5bXg5YAGGxbRldKbSxohPMDwmZpCuOAi+50CbFJE=;\n h=Subject:From:To:Date:Message-ID:MIME-Version;\n b=CZ8kFhGY4kiTzPhGd/iFQMhImtitO5ryzhAcOjsqr0UJPFou2SfPTr4C5DPDApHbGkEOOaPWfIJwl9v6kRRe4B0MHGAna1foAKWr/Tn/y0REf/YV+5lVHZmDq8YzqIYgn4M+Ye9ROUpoz6k2yYGDIjADGQgcVV7nPr0zJNh4m2E=","ARC-Authentication-Results":"i=1; server2.sourceware.org","Subject":"Re: [PATCH v1 0/3] libstdc++: Implement C++23 <flat_map> and\n <flat_set>","From":"ppalka via Sourceware Forge\n <forge-bot+ppalka@forge-stage.sourceware.org>","To":"gcc-patches mailing list <gcc-patches@gcc.gnu.org>","Date":"Tue, 17 Dec 2024 03:29:12 +0000","Message-ID":"\n <bmm.h2sn6puzuo.gcc.gcc-TEST.ppalka.9.525.CMT@forge-stage.sourceware.org>","In-Reply-To":"\n <bmm.hhuay3vzv6.gcc.gcc-TEST.ppalka.9.1.0@forge-stage.sourceware.org>","X-Mailer":"batrachomyomachia","X-Requested-Reviewer":"redi","X-Pull-Request-Organization":"gcc","X-Pull-Request-Repository":"gcc-TEST","X-Pull-Request":"https://forge.sourceware.org/gcc/gcc-TEST/pulls/9","X-Comment":"https://forge.sourceware.org/gcc/gcc-TEST/pulls/9#issuecomment-525","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"quoted-printable","MIME-Version":"1.0","X-BeenThere":"gcc-patches@gcc.gnu.org","X-Mailman-Version":"2.1.30","Precedence":"list","List-Id":"Gcc-patches mailing list <gcc-patches.gcc.gnu.org>","List-Unsubscribe":"<https://gcc.gnu.org/mailman/options/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe>","List-Archive":"<https://gcc.gnu.org/pipermail/gcc-patches/>","List-Post":"<mailto:gcc-patches@gcc.gnu.org>","List-Help":"<mailto:gcc-patches-request@gcc.gnu.org?subject=help>","List-Subscribe":"<https://gcc.gnu.org/mailman/listinfo/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe>","Errors-To":"gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org"}},{"id":3680417,"web_url":"http://patchwork.ozlabs.org/comment/3680417/","msgid":"<bmm.h1n47md3k0.gcc.gcc-TEST.redi.9.58.REVIEW@forge-stage.sourceware.org>","list_archive_url":null,"date":"2024-11-09T11:31:57","subject":"Re: [PATCH v1 0/3] libstdc++: Implement C++23 <flat_map> and\n <flat_set>","submitter":{"id":93210,"url":"http://patchwork.ozlabs.org/api/people/93210/","name":"Jonathan Wakely via Sourceware Forge","email":"forge-bot+redi@forge-stage.sourceware.org"},"content":"Jonathan Wakely (redi) <redi@gcc.gnu.org>) commented on the code:\n\n\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +683,4 @@\n> +\tcount(const _Key2& __x) const\n> +\t{\n> +\t  if constexpr (!_Multi && same_as<_Key2, _Key>)\n> +\t    return contains(__x);\nCould you drop the `same_as` condition and use `contains<_Key2>(__x)`?\n\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +683,4 @@\n> +\tcount(const _Key2& __x) const\n> +\t{\n> +\t  if constexpr (!_Multi && same_as<_Key2, _Key>)\n> +\t    return contains(__x);\nGood point, I don't see why not! Fixed.\n\n\n--\nhttps://forge.sourceware.org/gcc/gcc-TEST/pulls/9#issuecomment-329","headers":{"Return-Path":"<gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org>","X-Original-To":["incoming@patchwork.ozlabs.org","gcc-patches@gcc.gnu.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","gcc-patches@gcc.gnu.org"],"Authentication-Results":["legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=2620:52:6:3111::32; helo=vm01.sourceware.org;\n envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org;\n receiver=patchwork.ozlabs.org)","sourceware.org; dmarc=none (p=none dis=none)\n header.from=forge-stage.sourceware.org","sourceware.org;\n spf=pass smtp.mailfrom=forge-stage.sourceware.org","server2.sourceware.org;\n arc=none smtp.remote-ip=38.145.34.39"],"Received":["from vm01.sourceware.org (vm01.sourceware.org\n [IPv6:2620:52:6:3111::32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g0wJF6ZK7z1yD5\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 20:22:05 +1000 (AEST)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id A9CF94BAE7E3\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 10:22:03 +0000 (GMT)","from forge-stage.sourceware.org (vm08.sourceware.org [38.145.34.39])\n by sourceware.org (Postfix) with ESMTPS id 772394BAD160\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 10:16:07 +0000 (GMT)","from forge-stage.sourceware.org (localhost [IPv6:::1])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256)\n (No client certificate requested)\n by forge-stage.sourceware.org (Postfix) with ESMTPS id 5BD1C40565\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 10:16:03 +0000 (UTC)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org A9CF94BAE7E3","OpenDKIM Filter v2.11.0 sourceware.org 772394BAD160"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org 772394BAD160","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org 772394BAD160","ARC-Seal":"i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776852967; cv=none;\n b=rTEPZEZPAOTanAcxaidg1L7TLgkK8V+X8X/OdepBudonrSRGzVBg27vi9WXwvkZ9/nzXczVOTW130v8KKgOS9R9VbPUfKMj8Q7mlA1vmuFW8yFIjG1rLyctpU5/8zJo9C9iWKZmhh4+ydTFPwY341il3rN0ML5iad5b8BIDFg1o=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1776852967; c=relaxed/simple;\n bh=95XNg+6IdK7oNWrDK5qNYSaEI0mX+3Df2gOaLSNdSeg=;\n h=Subject:From:To:Date:Message-ID:MIME-Version;\n b=rDAZ88g6S2n02p3yiXNNPfNj9QurORyFSSjnN+kulT8nLiaiZAfKiT/xA/oEwx4vXFgqihvXQeNlypiY4WO0PKlqv3k/M2/a8jZh2Ub6EsrADHuMESTPSODnuS1aO/r1Y5pjk0izt0dMLO1bUppW1yu4PSVcSEbEgIHtHG+rGQw=","ARC-Authentication-Results":"i=1; server2.sourceware.org","Subject":"Re: [PATCH v1 0/3] libstdc++: Implement C++23 <flat_map> and\n <flat_set>","From":"Jonathan Wakely via Sourceware Forge\n <forge-bot+redi@forge-stage.sourceware.org>","To":"gcc-patches mailing list <gcc-patches@gcc.gnu.org>","Date":"Sat, 09 Nov 2024 11:31:57 +0000","Message-ID":"\n <bmm.h1n47md3k0.gcc.gcc-TEST.redi.9.58.REVIEW@forge-stage.sourceware.org>","In-Reply-To":"\n <bmm.hhuay3vzv6.gcc.gcc-TEST.ppalka.9.1.0@forge-stage.sourceware.org>","X-Mailer":"batrachomyomachia","X-Requested-Reviewer":"redi","X-Pull-Request-Organization":"gcc","X-Pull-Request-Repository":"gcc-TEST","X-Pull-Request":"https://forge.sourceware.org/gcc/gcc-TEST/pulls/9","X-Review":"https://forge.sourceware.org/gcc/gcc-TEST/pulls/9#issuecomment-329","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"7bit","MIME-Version":"1.0","X-BeenThere":"gcc-patches@gcc.gnu.org","X-Mailman-Version":"2.1.30","Precedence":"list","List-Id":"Gcc-patches mailing list <gcc-patches.gcc.gnu.org>","List-Unsubscribe":"<https://gcc.gnu.org/mailman/options/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe>","List-Archive":"<https://gcc.gnu.org/pipermail/gcc-patches/>","List-Post":"<mailto:gcc-patches@gcc.gnu.org>","List-Help":"<mailto:gcc-patches-request@gcc.gnu.org?subject=help>","List-Subscribe":"<https://gcc.gnu.org/mailman/listinfo/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe>","Errors-To":"gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org"}},{"id":3680419,"web_url":"http://patchwork.ozlabs.org/comment/3680419/","msgid":"<bmm.h1n2pk330g.gcc.gcc-TEST.redi.9.49.REVIEW@forge-stage.sourceware.org>","list_archive_url":null,"date":"2024-11-09T10:37:28","subject":"Re: [PATCH v1 0/3] libstdc++: Implement C++23 <flat_map> and\n <flat_set>","submitter":{"id":93210,"url":"http://patchwork.ozlabs.org/api/people/93210/","name":"Jonathan Wakely via Sourceware Forge","email":"forge-bot+redi@forge-stage.sourceware.org"},"content":"Jonathan Wakely (redi) <redi@gcc.gnu.org>) commented on the code:\n\n\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +421,4 @@\n> +\t    if (__key_it != _M_cont.keys.end() && !_M_comp(__k, __key_it[0]))\n> +\t      return {iterator{this, __key_it}, false};\n> +\n> +\t  __key_it = _M_cont.keys.insert(__key_it, std::move(__k));\nIf this insertion throws, we don't know what state `_M_cont.keys` is in. An arbitrary user-defined sequence might not give strong exception safety here. So basically if any insertion throws, we need to call `clear()` before returning.\n\nWe can do a special case for `std::vector` in _some_ places, and maybe for `vector<NothrowMoveInsertable>` here (so we know only the re-allocation can throw, and if that happens then `_M_cont.keys` will be unchanged). But in general, we need to `clear()` after any modification of `_M_cont.keys` or `_M_cont.values` that throws. `flat_map` is lossy on throwing operations.\n\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +421,4 @@\n> +\t    if (__key_it != _M_cont.keys.end() && !_M_comp(__k, __key_it[0]))\n> +\t      return {iterator{this, __key_it}, false};\n> +\n> +\t  __key_it = _M_cont.keys.insert(__key_it, std::move(__k));\nSpecial case optimizations for `vector<NothrowMoveInsertable>` can be added later though. Just getting the general case right for now is good enough.\n\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +421,4 @@\n> +\t    if (__key_it != _M_cont.keys.end() && !_M_comp(__k, __key_it[0]))\n> +\t      return {iterator{this, __key_it}, false};\n> +\n> +\t  __key_it = _M_cont.keys.insert(__key_it, std::move(__k));\nAh, I think I wrongly assumed the exception guarantees in https://eel.is/c++draft/container.requirements#container.reqmts-66 hold for any container that a user wants to adapt with `flat_map/set`, even a user-defined one.  Fixed this code path to clear both containers upon encountering an exception (with the help of a new RAII helper).\n\n\n--\nhttps://forge.sourceware.org/gcc/gcc-TEST/pulls/9#issuecomment-309","headers":{"Return-Path":"<gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org>","X-Original-To":["incoming@patchwork.ozlabs.org","gcc-patches@gcc.gnu.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","gcc-patches@gcc.gnu.org"],"Authentication-Results":["legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=2620:52:6:3111::32; helo=vm01.sourceware.org;\n envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org;\n receiver=patchwork.ozlabs.org)","sourceware.org; dmarc=none (p=none dis=none)\n header.from=forge-stage.sourceware.org","sourceware.org;\n spf=pass smtp.mailfrom=forge-stage.sourceware.org","server2.sourceware.org;\n arc=none smtp.remote-ip=38.145.34.39"],"Received":["from vm01.sourceware.org (vm01.sourceware.org\n [IPv6:2620:52:6:3111::32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g0wJT5FWSz1yD5\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 20:22:17 +1000 (AEST)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 521504BB5887\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 10:22:15 +0000 (GMT)","from forge-stage.sourceware.org (vm08.sourceware.org [38.145.34.39])\n by sourceware.org (Postfix) with ESMTPS id 17DC04B9DB72\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 10:16:06 +0000 (GMT)","from forge-stage.sourceware.org (localhost [IPv6:::1])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256)\n (No client certificate requested)\n by forge-stage.sourceware.org (Postfix) with ESMTPS id 8C1154055B\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 10:16:02 +0000 (UTC)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org 521504BB5887","OpenDKIM Filter v2.11.0 sourceware.org 17DC04B9DB72"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org 17DC04B9DB72","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org 17DC04B9DB72","ARC-Seal":"i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776852966; cv=none;\n b=XtGYyvAXWdLnGYi0iOulb351UeR2tPQc1h6YO3QDxfhnocZieN7Fn3kO1p2+IOFZH+cvHZFa/bahS+bJwgODSy5F2B7MVnRXtrJFBQn28Wdy7Ei0wTHttC4IFa574ihCVS/BwxE00JgAL9leMva44CYo8MHyrftgh/RIsKC9QCw=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1776852966; c=relaxed/simple;\n bh=tGe5yr9sZ+NtaA9yCDllDM0W2goSqocyVJYuAD8I00c=;\n h=Subject:From:To:Date:Message-ID:MIME-Version;\n b=lecsaj+WHTQlwpW+a3DyAq+5Hk+aEAl56JRJUGFyi2DunrN/vUs5mQbY4d4+j5zTqbgnIstUPmjlvGHDkVy+ns88oKf4iIbBZImdw7MoBEGhyE6v/Zf7cVlDbIEz2vT0FGZOyqTatWi0siFrQeIy5vg2SzC0hYOcEXwNvGi1OPo=","ARC-Authentication-Results":"i=1; server2.sourceware.org","Subject":"Re: [PATCH v1 0/3] libstdc++: Implement C++23 <flat_map> and\n <flat_set>","From":"Jonathan Wakely via Sourceware Forge\n <forge-bot+redi@forge-stage.sourceware.org>","To":"gcc-patches mailing list <gcc-patches@gcc.gnu.org>","Date":"Sat, 09 Nov 2024 10:37:28 +0000","Message-ID":"\n <bmm.h1n2pk330g.gcc.gcc-TEST.redi.9.49.REVIEW@forge-stage.sourceware.org>","In-Reply-To":"\n <bmm.hhuay3vzv6.gcc.gcc-TEST.ppalka.9.1.0@forge-stage.sourceware.org>","X-Mailer":"batrachomyomachia","X-Requested-Reviewer":"redi","X-Pull-Request-Organization":"gcc","X-Pull-Request-Repository":"gcc-TEST","X-Pull-Request":"https://forge.sourceware.org/gcc/gcc-TEST/pulls/9","X-Review":"https://forge.sourceware.org/gcc/gcc-TEST/pulls/9#issuecomment-309","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"quoted-printable","MIME-Version":"1.0","X-BeenThere":"gcc-patches@gcc.gnu.org","X-Mailman-Version":"2.1.30","Precedence":"list","List-Id":"Gcc-patches mailing list <gcc-patches.gcc.gnu.org>","List-Unsubscribe":"<https://gcc.gnu.org/mailman/options/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe>","List-Archive":"<https://gcc.gnu.org/pipermail/gcc-patches/>","List-Post":"<mailto:gcc-patches@gcc.gnu.org>","List-Help":"<mailto:gcc-patches-request@gcc.gnu.org?subject=help>","List-Subscribe":"<https://gcc.gnu.org/mailman/listinfo/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe>","Errors-To":"gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org"}},{"id":3680420,"web_url":"http://patchwork.ozlabs.org/comment/3680420/","msgid":"<bmm.h2uh03c0jk.gcc.gcc-TEST.redi.9.87.REVIEW@forge-stage.sourceware.org>","list_archive_url":null,"date":"2024-12-18T19:16:59","subject":"Re: [PATCH v1 0/3] libstdc++: Implement C++23 <flat_map> and\n <flat_set>","submitter":{"id":93210,"url":"http://patchwork.ozlabs.org/api/people/93210/","name":"Jonathan Wakely via Sourceware Forge","email":"forge-bot+redi@forge-stage.sourceware.org"},"content":"Jonathan Wakely (redi) <redi@gcc.gnu.org>) commented on the code:\n\n\n> +++ libstdc++-v3/testsuite/23_containers/flat_multimap/1.cc\n> @@ -0,0 +10,4 @@\n> +void\n> +test01()\n> +{\n> +  std::flat_multimap<int, int, std::less<int>, Sequence<int>, Sequence<int>> m;\nIt would be good to test that using two different sequence types works, just to be sure there are no accidental mixups between `key_container::iterator` and `mapped_container::iterator` in the implementation.\n\n\n--\nhttps://forge.sourceware.org/gcc/gcc-TEST/pulls/9#issuecomment-553","headers":{"Return-Path":"<gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org>","X-Original-To":["incoming@patchwork.ozlabs.org","gcc-patches@gcc.gnu.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","gcc-patches@gcc.gnu.org"],"Authentication-Results":["legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=2620:52:6:3111::32; helo=vm01.sourceware.org;\n envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org;\n receiver=patchwork.ozlabs.org)","sourceware.org; dmarc=none (p=none dis=none)\n header.from=forge-stage.sourceware.org","sourceware.org;\n spf=pass smtp.mailfrom=forge-stage.sourceware.org","server2.sourceware.org;\n arc=none smtp.remote-ip=38.145.34.39"],"Received":["from vm01.sourceware.org (vm01.sourceware.org\n [IPv6:2620:52:6:3111::32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g0wK85dkxz1yD5\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 20:22:52 +1000 (AEST)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 33EFC4BB588A\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 10:22:50 +0000 (GMT)","from forge-stage.sourceware.org (vm08.sourceware.org [38.145.34.39])\n by sourceware.org (Postfix) with ESMTPS id CDE324BAD167\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 10:16:11 +0000 (GMT)","from forge-stage.sourceware.org (localhost [IPv6:::1])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256)\n (No client certificate requested)\n by forge-stage.sourceware.org (Postfix) with ESMTPS id 58F9540571\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 10:16:04 +0000 (UTC)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org 33EFC4BB588A","OpenDKIM Filter v2.11.0 sourceware.org CDE324BAD167"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org CDE324BAD167","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org CDE324BAD167","ARC-Seal":"i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776852971; cv=none;\n b=epxppyySKDnSHuwD9zl+ex0xl6EE39sXpALrvtCKsxgt+dTh1Gdvkv/0rD0OVsQ4HNj5IDQqa4dUrMPl3Hch2/c2/+zfuOAcZx+we4uNGi8FF0gu2E/ddzej7AasmLDCjbMiMXsZtm7P00U0G+Nz/CKJEI+KQturfNaF44OvdFg=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1776852971; c=relaxed/simple;\n bh=F7EFbCclYsLqrovaP/a8dycU3JaNLFGatl58RrJtHDc=;\n h=Subject:From:To:Date:Message-ID:MIME-Version;\n b=bE0O2f9iEjmGe1uYB4qCDmXAX7G1590CtnFQrKgka6bufaLqktFq1hrFBMF0KO3Dza/WZyrmI6o1oYVQfefIz2pjc6lV+l07TSO4+FsvrJzYwRbHJM0dEfz9+JYFvRf1gQ9M77gTVZ6XlBiEB8cH/yYpwf93BY8ooH5CTi+bBeU=","ARC-Authentication-Results":"i=1; server2.sourceware.org","Subject":"Re: [PATCH v1 0/3] libstdc++: Implement C++23 <flat_map> and\n <flat_set>","From":"Jonathan Wakely via Sourceware Forge\n <forge-bot+redi@forge-stage.sourceware.org>","To":"gcc-patches mailing list <gcc-patches@gcc.gnu.org>","Date":"Wed, 18 Dec 2024 19:16:59 +0000","Message-ID":"\n <bmm.h2uh03c0jk.gcc.gcc-TEST.redi.9.87.REVIEW@forge-stage.sourceware.org>","In-Reply-To":"\n <bmm.hhuay3vzv6.gcc.gcc-TEST.ppalka.9.1.0@forge-stage.sourceware.org>","X-Mailer":"batrachomyomachia","X-Requested-Reviewer":"redi","X-Pull-Request-Organization":"gcc","X-Pull-Request-Repository":"gcc-TEST","X-Pull-Request":"https://forge.sourceware.org/gcc/gcc-TEST/pulls/9","X-Review":"https://forge.sourceware.org/gcc/gcc-TEST/pulls/9#issuecomment-553","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"quoted-printable","MIME-Version":"1.0","X-BeenThere":"gcc-patches@gcc.gnu.org","X-Mailman-Version":"2.1.30","Precedence":"list","List-Id":"Gcc-patches mailing list <gcc-patches.gcc.gnu.org>","List-Unsubscribe":"<https://gcc.gnu.org/mailman/options/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe>","List-Archive":"<https://gcc.gnu.org/pipermail/gcc-patches/>","List-Post":"<mailto:gcc-patches@gcc.gnu.org>","List-Help":"<mailto:gcc-patches-request@gcc.gnu.org?subject=help>","List-Subscribe":"<https://gcc.gnu.org/mailman/listinfo/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe>","Errors-To":"gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org"}},{"id":3680421,"web_url":"http://patchwork.ozlabs.org/comment/3680421/","msgid":"<bmm.h1n4j8wtts.gcc.gcc-TEST.redi.9.62.REVIEW@forge-stage.sourceware.org>","list_archive_url":null,"date":"2024-11-09T11:43:40","subject":"Re: [PATCH v1 0/3] libstdc++: Implement C++23 <flat_map> and\n <flat_set>","submitter":{"id":93210,"url":"http://patchwork.ozlabs.org/api/people/93210/","name":"Jonathan Wakely via Sourceware Forge","email":"forge-bot+redi@forge-stage.sourceware.org"},"content":"Jonathan Wakely (redi) <redi@gcc.gnu.org>) commented on the code:\n\n\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +828,4 @@\n> +      [[no_unique_address]] _Compare _M_comp;\n> +\n> +      void\n> +      _M_sort_uniq()\nIf this (or _M_unique) throws then invariants might be broken, but I think it's OK to ignore that here and leave callers to be responsible for doing clear()\n\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +828,4 @@\n> +      [[no_unique_address]] _Compare _M_comp;\n> +\n> +      void\n> +      _M_sort_uniq()\nAh, especially because _M_sort_uniq is used from constructors, so it would be useless for _M_sort_uniq to call clear() when there's no object left to care about its invariants.\n\n\n--\nhttps://forge.sourceware.org/gcc/gcc-TEST/pulls/9#issuecomment-337","headers":{"Return-Path":"<gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org>","X-Original-To":["incoming@patchwork.ozlabs.org","gcc-patches@gcc.gnu.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","gcc-patches@gcc.gnu.org"],"Authentication-Results":["legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=2620:52:6:3111::32; helo=vm01.sourceware.org;\n envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org;\n receiver=patchwork.ozlabs.org)","sourceware.org; dmarc=none (p=none dis=none)\n header.from=forge-stage.sourceware.org","sourceware.org;\n spf=pass smtp.mailfrom=forge-stage.sourceware.org","server2.sourceware.org;\n arc=none smtp.remote-ip=38.145.34.39"],"Received":["from vm01.sourceware.org (vm01.sourceware.org\n [IPv6:2620:52:6:3111::32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g0wKD5cDfz1yD5\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 20:22:56 +1000 (AEST)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id A34864BB3BF0\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 10:22:54 +0000 (GMT)","from forge-stage.sourceware.org (vm08.sourceware.org [38.145.34.39])\n by sourceware.org (Postfix) with ESMTPS id CEFE64BAD155\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 10:16:10 +0000 (GMT)","from forge-stage.sourceware.org (localhost [IPv6:::1])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256)\n (No client certificate requested)\n by forge-stage.sourceware.org (Postfix) with ESMTPS id ACED440569\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 10:16:03 +0000 (UTC)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org A34864BB3BF0","OpenDKIM Filter v2.11.0 sourceware.org CEFE64BAD155"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org CEFE64BAD155","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org CEFE64BAD155","ARC-Seal":"i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776852970; cv=none;\n b=GN91so2MHUHmAZkhpHbQoGtKOKLztsvSeIHC83880Jn13opAIKgWYDHxPMEKHTONhqGQwQqLe/PnFRe7SJpsf5ZuFuDvDeXci50oMDY8FtPDPiLEBMuGSL8SqAdbG/kW01L5LB6lWyvt09T1kW1YDaQyWqZuTpF9REYQgjFUJmQ=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1776852970; c=relaxed/simple;\n bh=HRqlODJKtuKcHsxEOTVKJY5WAUfYvTuXEC5vNf7nqZ0=;\n h=Subject:From:To:Date:Message-ID:MIME-Version;\n b=YrmJ6qfGZCM5NEMjh6Ji0opQnxjyRryHO/PBB/3aKbKTNfXhloagnFHSW5AK9BtlNENlofG9FaT601Xa+UGnUMlmWuXm5Je/57JHWef2wq6AjW/7kNiql5zAZrDVxc831C0tUenG/nuE629nU9t3TH8N0F3VSQ9Qb8ZxVDNtjuo=","ARC-Authentication-Results":"i=1; server2.sourceware.org","Subject":"Re: [PATCH v1 0/3] libstdc++: Implement C++23 <flat_map> and\n <flat_set>","From":"Jonathan Wakely via Sourceware Forge\n <forge-bot+redi@forge-stage.sourceware.org>","To":"gcc-patches mailing list <gcc-patches@gcc.gnu.org>","Date":"Sat, 09 Nov 2024 11:43:40 +0000","Message-ID":"\n <bmm.h1n4j8wtts.gcc.gcc-TEST.redi.9.62.REVIEW@forge-stage.sourceware.org>","In-Reply-To":"\n <bmm.hhuay3vzv6.gcc.gcc-TEST.ppalka.9.1.0@forge-stage.sourceware.org>","X-Mailer":"batrachomyomachia","X-Requested-Reviewer":"redi","X-Pull-Request-Organization":"gcc","X-Pull-Request-Repository":"gcc-TEST","X-Pull-Request":"https://forge.sourceware.org/gcc/gcc-TEST/pulls/9","X-Review":"https://forge.sourceware.org/gcc/gcc-TEST/pulls/9#issuecomment-337","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"quoted-printable","MIME-Version":"1.0","X-BeenThere":"gcc-patches@gcc.gnu.org","X-Mailman-Version":"2.1.30","Precedence":"list","List-Id":"Gcc-patches mailing list <gcc-patches.gcc.gnu.org>","List-Unsubscribe":"<https://gcc.gnu.org/mailman/options/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe>","List-Archive":"<https://gcc.gnu.org/pipermail/gcc-patches/>","List-Post":"<mailto:gcc-patches@gcc.gnu.org>","List-Help":"<mailto:gcc-patches-request@gcc.gnu.org?subject=help>","List-Subscribe":"<https://gcc.gnu.org/mailman/listinfo/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe>","Errors-To":"gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org"}},{"id":3680422,"web_url":"http://patchwork.ozlabs.org/comment/3680422/","msgid":"<bmm.h2uiz9to74.gcc.gcc-TEST.redi.9.88.REVIEW@forge-stage.sourceware.org>","list_archive_url":null,"date":"2024-12-18T20:28:43","subject":"Re: [PATCH v1 0/3] libstdc++: Implement C++23 <flat_map> and\n <flat_set>","submitter":{"id":93210,"url":"http://patchwork.ozlabs.org/api/people/93210/","name":"Jonathan Wakely via Sourceware Forge","email":"forge-bot+redi@forge-stage.sourceware.org"},"content":"Jonathan Wakely (redi) <redi@gcc.gnu.org>) commented on the code:\n\n\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +213,4 @@\n> +      : _Flat_map_impl(__s, __il.begin(), __il.end(), __comp)\n> +      { }\n> +\n> +      // constructors with allocators\n[flat.map.cons.alloc]:\n\n>  The constructors in this subclause shall not participate in overload resolution unless `uses_allocator_v<key_container_type, Alloc>` is true and `uses_allocator_v<mapped_container_type, Alloc>` is true.\n\nSo the allocator-extended constructors need to be constrained.\n\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +213,4 @@\n> +      : _Flat_map_impl(__s, __il.begin(), __il.end(), __comp)\n> +      { }\n> +\n> +      // constructors with allocators\nAnd there's similar wording for flat_multimap, flat_set and flat_multiset of course.\n\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +213,4 @@\n> +      : _Flat_map_impl(__s, __il.begin(), __il.end(), __comp)\n> +      { }\n> +\n> +      // constructors with allocators\nOops, will do.  Should we also constrain the allocator-aware deduction guides the same way?  Right now they're constrained with effectively `_RequireAllocator<_Alloc>`, but that's a strictly weaker constraint IIUC.\n\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +213,4 @@\n> +      : _Flat_map_impl(__s, __il.begin(), __il.end(), __comp)\n> +      { }\n> +\n> +      // constructors with allocators\nAh yes, see [container.adaptors.general] p6 (6.5), (6.6), (6.8)\n\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +213,4 @@\n> +      : _Flat_map_impl(__s, __il.begin(), __il.end(), __comp)\n> +      { }\n> +\n> +      // constructors with allocators\nack (looks like the deduction guides for `stack`/`queue`/`priority_queue` might need tweaking as well)\n\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +213,4 @@\n> +      : _Flat_map_impl(__s, __il.begin(), __il.end(), __comp)\n> +      { }\n> +\n> +      // constructors with allocators\nMissing constraints on the allocator ctors and deduction guides should be fixed, modulo the http://eel.is/c++draft/container.adaptors.general#6.7 constraint (which seems to be missing in our other standard container adaptors as well).\nThat constraint seems like it's better suited on the class template rather than on the deduction guides?\n\n\n--\nhttps://forge.sourceware.org/gcc/gcc-TEST/pulls/9#issuecomment-556","headers":{"Return-Path":"<gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org>","X-Original-To":["incoming@patchwork.ozlabs.org","gcc-patches@gcc.gnu.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","gcc-patches@gcc.gnu.org"],"Authentication-Results":["legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=38.145.34.32; helo=vm01.sourceware.org;\n envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org;\n receiver=patchwork.ozlabs.org)","sourceware.org; dmarc=none (p=none dis=none)\n header.from=forge-stage.sourceware.org","sourceware.org;\n spf=pass smtp.mailfrom=forge-stage.sourceware.org","server2.sourceware.org;\n arc=none smtp.remote-ip=38.145.34.39"],"Received":["from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g0wKF5sQrz1yD5\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 20:22:57 +1000 (AEST)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id E7F0D4BAD149\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 10:22:55 +0000 (GMT)","from forge-stage.sourceware.org (vm08.sourceware.org [38.145.34.39])\n by sourceware.org (Postfix) with ESMTPS id F32794B9DB73\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 10:16:11 +0000 (GMT)","from forge-stage.sourceware.org (localhost [IPv6:::1])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256)\n (No client certificate requested)\n by forge-stage.sourceware.org (Postfix) with ESMTPS id 6D98440572\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 10:16:04 +0000 (UTC)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org E7F0D4BAD149","OpenDKIM Filter v2.11.0 sourceware.org F32794B9DB73"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org F32794B9DB73","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org F32794B9DB73","ARC-Seal":"i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776852972; cv=none;\n b=aiDqz92liz1EM9OTd6Vx2KLxtpjOya2zi9HvH1yl62DRrvSKULYIqM18aK+90a5m2DrHyA5HZ5oDCLvHYwNBpSjKTrweAU5WlVqLbavuBIVLP5L6Pvmm/JbxZkd+FbbcTvnv6g4XadgQkdX2i3FC23UkFKFTrARa8LUsiPzhyEs=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1776852972; c=relaxed/simple;\n bh=qK0Ayjn+JpelyCkVayDFilQdo9VPxjebDdMOFEjzs5I=;\n h=Subject:From:To:Date:Message-ID:MIME-Version;\n b=AWvK5rzXxmczfJGaBRu7Ivfy6B2kTjY1SH9Ws6fNkqyhJHZsDZ3AbTAEi7anO2zJb87ge44zB6dw4PDLPWydAxqoi4Aw9vmzTnbs42ORU3sOnVIG3BH3kz6mmLmc8ZZaN/eldutuaOdpMOuTAuG8rjhMRB0wgfCZLyZQAbeTNcA=","ARC-Authentication-Results":"i=1; server2.sourceware.org","Subject":"Re: [PATCH v1 0/3] libstdc++: Implement C++23 <flat_map> and\n <flat_set>","From":"Jonathan Wakely via Sourceware Forge\n <forge-bot+redi@forge-stage.sourceware.org>","To":"gcc-patches mailing list <gcc-patches@gcc.gnu.org>","Date":"Wed, 18 Dec 2024 20:28:43 +0000","Message-ID":"\n <bmm.h2uiz9to74.gcc.gcc-TEST.redi.9.88.REVIEW@forge-stage.sourceware.org>","In-Reply-To":"\n <bmm.hhuay3vzv6.gcc.gcc-TEST.ppalka.9.1.0@forge-stage.sourceware.org>","X-Mailer":"batrachomyomachia","X-Requested-Reviewer":"redi","X-Pull-Request-Organization":"gcc","X-Pull-Request-Repository":"gcc-TEST","X-Pull-Request":"https://forge.sourceware.org/gcc/gcc-TEST/pulls/9","X-Review":"https://forge.sourceware.org/gcc/gcc-TEST/pulls/9#issuecomment-556","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"quoted-printable","MIME-Version":"1.0","X-BeenThere":"gcc-patches@gcc.gnu.org","X-Mailman-Version":"2.1.30","Precedence":"list","List-Id":"Gcc-patches mailing list <gcc-patches.gcc.gnu.org>","List-Unsubscribe":"<https://gcc.gnu.org/mailman/options/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe>","List-Archive":"<https://gcc.gnu.org/pipermail/gcc-patches/>","List-Post":"<mailto:gcc-patches@gcc.gnu.org>","List-Help":"<mailto:gcc-patches-request@gcc.gnu.org?subject=help>","List-Subscribe":"<https://gcc.gnu.org/mailman/listinfo/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe>","Errors-To":"gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org"}},{"id":3680423,"web_url":"http://patchwork.ozlabs.org/comment/3680423/","msgid":"<bmm.h1n4flc14w.gcc.gcc-TEST.redi.9.60.REVIEW@forge-stage.sourceware.org>","list_archive_url":null,"date":"2024-11-09T11:39:59","subject":"Re: [PATCH v1 0/3] libstdc++: Implement C++23 <flat_map> and\n <flat_set>","submitter":{"id":93210,"url":"http://patchwork.ozlabs.org/api/people/93210/","name":"Jonathan Wakely via Sourceware Forge","email":"forge-bot+redi@forge-stage.sourceware.org"},"content":"Jonathan Wakely (redi) <redi@gcc.gnu.org>) commented on the code:\n\n\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +722,4 @@\n> +      template<typename _Key2>\n> +\trequires same_as<_Key2, _Key> || __transparent_comparator<_Compare>\n> +\tconst_iterator\n> +\tlower_bound(const _Key2& __x) const\nIt's annoying that we can't use \"deducing this\" for these pairs of const/non-const overloads, but the return types make it awkward. We could do:\n```c++\ntemplate<typename T>\nusing __iter = __conditional_t<is_const_v<T>, const_iterator, iterator>;\n\ntemplate<typename Self, typename K2>\nrequires ...\n__iter<Self>\nlower_bound(this Self& self, const K2& k)\n{\n    auto __it = std::lower_bound(_M_cont.keys.begin(), _M_cont.keys.end(),\n\t\t\t\t       __x, _M_comp);\n    return {this, __it};\n}\n```\n\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +722,4 @@\n> +      template<typename _Key2>\n> +\trequires same_as<_Key2, _Key> || __transparent_comparator<_Compare>\n> +\tconst_iterator\n> +\tlower_bound(const _Key2& __x) const\nAnd then we'd need to uglify the member accesses into `__like_t<_Self&, _Flat_map_impl>(self)._M_cont` etc, so doesn't seem worth it unfortunately \n\n\n--\nhttps://forge.sourceware.org/gcc/gcc-TEST/pulls/9#issuecomment-333","headers":{"Return-Path":"<gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org>","X-Original-To":["incoming@patchwork.ozlabs.org","gcc-patches@gcc.gnu.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","gcc-patches@gcc.gnu.org"],"Authentication-Results":["legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=2620:52:6:3111::32; helo=vm01.sourceware.org;\n envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org;\n receiver=patchwork.ozlabs.org)","sourceware.org; dmarc=none (p=none dis=none)\n header.from=forge-stage.sourceware.org","sourceware.org;\n spf=pass smtp.mailfrom=forge-stage.sourceware.org","server2.sourceware.org;\n arc=none smtp.remote-ip=38.145.34.39"],"Received":["from vm01.sourceware.org (vm01.sourceware.org\n [IPv6:2620:52:6:3111::32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g0wKk5RDHz1yD5\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 20:23:22 +1000 (AEST)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id B01F64BB5888\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 10:23:20 +0000 (GMT)","from forge-stage.sourceware.org (vm08.sourceware.org [38.145.34.39])\n by sourceware.org (Postfix) with ESMTPS id B2FD44B9DB76\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 10:16:07 +0000 (GMT)","from forge-stage.sourceware.org (localhost [IPv6:::1])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256)\n (No client certificate requested)\n by forge-stage.sourceware.org (Postfix) with ESMTPS id 8708B40567\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 10:16:03 +0000 (UTC)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org B01F64BB5888","OpenDKIM Filter v2.11.0 sourceware.org B2FD44B9DB76"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org B2FD44B9DB76","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org B2FD44B9DB76","ARC-Seal":"i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776852967; cv=none;\n b=nkKDCewIy4ykphbsMkXkGV31BX4bvKrZgFMAPuAsjlwfIoUcV7Pj3SPCF0ComVObuedjCmNFey23MYt+/Ue0uQyJjwkf4FyLq6da1ENEsodaxYAGceHlMO2UMJ5NSsK0/vEuO9KPzTP2MnQhrMio+mfF8wkbJf2yEXiNVZyJUSc=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1776852967; c=relaxed/simple;\n bh=zFD3SrK7sveCcbxjwoJI0of7smR8FtLuoObfFvdFqfA=;\n h=Subject:From:To:Date:Message-ID:MIME-Version;\n b=CpoQCtdHwMZeCj7mf+yuLci+2FZd4Fa8MPPjjE8qct3QaxvzFKCPsBGXb0b/FQSFC+TGsbMI5FVGGZpMrISTykzh7PEgLmudtsnrKHFqAf1w46HF6tfiRKjyB432oCp9v2GGL/RYRmISDX0S9EAGdedrRVA5+KXAwRkelJ1vY0A=","ARC-Authentication-Results":"i=1; server2.sourceware.org","Subject":"Re: [PATCH v1 0/3] libstdc++: Implement C++23 <flat_map> and\n <flat_set>","From":"Jonathan Wakely via Sourceware Forge\n <forge-bot+redi@forge-stage.sourceware.org>","To":"gcc-patches mailing list <gcc-patches@gcc.gnu.org>","Date":"Sat, 09 Nov 2024 11:39:59 +0000","Message-ID":"\n <bmm.h1n4flc14w.gcc.gcc-TEST.redi.9.60.REVIEW@forge-stage.sourceware.org>","In-Reply-To":"\n <bmm.hhuay3vzv6.gcc.gcc-TEST.ppalka.9.1.0@forge-stage.sourceware.org>","X-Mailer":"batrachomyomachia","X-Requested-Reviewer":"redi","X-Pull-Request-Organization":"gcc","X-Pull-Request-Repository":"gcc-TEST","X-Pull-Request":"https://forge.sourceware.org/gcc/gcc-TEST/pulls/9","X-Review":"https://forge.sourceware.org/gcc/gcc-TEST/pulls/9#issuecomment-333","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"quoted-printable","MIME-Version":"1.0","X-BeenThere":"gcc-patches@gcc.gnu.org","X-Mailman-Version":"2.1.30","Precedence":"list","List-Id":"Gcc-patches mailing list <gcc-patches.gcc.gnu.org>","List-Unsubscribe":"<https://gcc.gnu.org/mailman/options/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe>","List-Archive":"<https://gcc.gnu.org/pipermail/gcc-patches/>","List-Post":"<mailto:gcc-patches@gcc.gnu.org>","List-Help":"<mailto:gcc-patches-request@gcc.gnu.org?subject=help>","List-Subscribe":"<https://gcc.gnu.org/mailman/listinfo/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe>","Errors-To":"gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org"}},{"id":3680424,"web_url":"http://patchwork.ozlabs.org/comment/3680424/","msgid":"<bmm.h1n3vm4edc.gcc.gcc-TEST.redi.9.55.REVIEW@forge-stage.sourceware.org>","list_archive_url":null,"date":"2024-11-09T11:19:51","subject":"Re: [PATCH v1 0/3] libstdc++: Implement C++23 <flat_map> and\n <flat_set>","submitter":{"id":93210,"url":"http://patchwork.ozlabs.org/api/people/93210/","name":"Jonathan Wakely via Sourceware Forge","email":"forge-bot+redi@forge-stage.sourceware.org"},"content":"Jonathan Wakely (redi) <redi@gcc.gnu.org>) commented on the code:\n\n\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +604,4 @@\n> +\tauto __it = _M_cont.keys.erase(_M_cont.keys.begin() + __first._M_index,\n> +\t\t\t\t       _M_cont.keys.begin() + __last._M_index);\n> +\t_M_cont.values.erase(_M_cont.values.begin() + __first._M_index,\n> +\t\t\t     _M_cont.values.begin() + __last._M_index);\nclear on exception\n\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +604,4 @@\n> +\tauto __it = _M_cont.keys.erase(_M_cont.keys.begin() + __first._M_index,\n> +\t\t\t\t       _M_cont.keys.begin() + __last._M_index);\n> +\t_M_cont.values.erase(_M_cont.values.begin() + __first._M_index,\n> +\t\t\t     _M_cont.values.begin() + __last._M_index);\nFixed\n\n\n--\nhttps://forge.sourceware.org/gcc/gcc-TEST/pulls/9#issuecomment-323","headers":{"Return-Path":"<gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org>","X-Original-To":["incoming@patchwork.ozlabs.org","gcc-patches@gcc.gnu.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","gcc-patches@gcc.gnu.org"],"Authentication-Results":["legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=38.145.34.32; helo=vm01.sourceware.org;\n envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org;\n receiver=patchwork.ozlabs.org)","sourceware.org; dmarc=none (p=none dis=none)\n header.from=forge-stage.sourceware.org","sourceware.org;\n spf=pass smtp.mailfrom=forge-stage.sourceware.org","server2.sourceware.org;\n arc=none smtp.remote-ip=38.145.34.39"],"Received":["from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g0wLB1YXsz1yD5\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 20:23:46 +1000 (AEST)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 410D14BB58A8\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 10:23:44 +0000 (GMT)","from forge-stage.sourceware.org (vm08.sourceware.org [38.145.34.39])\n by sourceware.org (Postfix) with ESMTPS id 3D9434BAD166\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 10:16:07 +0000 (GMT)","from forge-stage.sourceware.org (localhost [IPv6:::1])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256)\n (No client certificate requested)\n by forge-stage.sourceware.org (Postfix) with ESMTPS id 16D8440561\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 10:16:03 +0000 (UTC)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org 410D14BB58A8","OpenDKIM Filter v2.11.0 sourceware.org 3D9434BAD166"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org 3D9434BAD166","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org 3D9434BAD166","ARC-Seal":"i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776852967; cv=none;\n b=CgPE25IsZtlpZjTLtOkp09Opu5KZvMqIae8e5qhRcYjbUJmEy0tRID9LeOYMlRFyOEIEXWEwE1JrBHP+iSwBkIlJmEJ2/q0rQTr0T04tfX0JXMzXaPRg5G2rCQh+TvX/Im9HS+2j+F/rNU0A/Kjel0tydrvdLwoLwbfy35H72rM=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1776852967; c=relaxed/simple;\n bh=cxuWA8DbY1fJf3UV0KiVccCQHI8zubbFjMlrL0T91UA=;\n h=Subject:From:To:Date:Message-ID:MIME-Version;\n b=QCUvUtTPUWOlpx/OlDXamfs5xOAq3UKX1ohfMDXcaJbEdS10ugErZfsh5x94iYWW9128DmiN9heV0YGtvz3sscUJ6Hjhjg7+Q4nnA5eoBAkeKO/YwYNANMXLkbZQWmh2H1aEWNr/Y6MT8DsXdJjSxkD7PC/DwY030wQzD+GzRGQ=","ARC-Authentication-Results":"i=1; server2.sourceware.org","Subject":"Re: [PATCH v1 0/3] libstdc++: Implement C++23 <flat_map> and\n <flat_set>","From":"Jonathan Wakely via Sourceware Forge\n <forge-bot+redi@forge-stage.sourceware.org>","To":"gcc-patches mailing list <gcc-patches@gcc.gnu.org>","Date":"Sat, 09 Nov 2024 11:19:51 +0000","Message-ID":"\n <bmm.h1n3vm4edc.gcc.gcc-TEST.redi.9.55.REVIEW@forge-stage.sourceware.org>","In-Reply-To":"\n <bmm.hhuay3vzv6.gcc.gcc-TEST.ppalka.9.1.0@forge-stage.sourceware.org>","X-Mailer":"batrachomyomachia","X-Requested-Reviewer":"redi","X-Pull-Request-Organization":"gcc","X-Pull-Request-Repository":"gcc-TEST","X-Pull-Request":"https://forge.sourceware.org/gcc/gcc-TEST/pulls/9","X-Review":"https://forge.sourceware.org/gcc/gcc-TEST/pulls/9#issuecomment-323","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"7bit","MIME-Version":"1.0","X-BeenThere":"gcc-patches@gcc.gnu.org","X-Mailman-Version":"2.1.30","Precedence":"list","List-Id":"Gcc-patches mailing list <gcc-patches.gcc.gnu.org>","List-Unsubscribe":"<https://gcc.gnu.org/mailman/options/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe>","List-Archive":"<https://gcc.gnu.org/pipermail/gcc-patches/>","List-Post":"<mailto:gcc-patches@gcc.gnu.org>","List-Help":"<mailto:gcc-patches-request@gcc.gnu.org?subject=help>","List-Subscribe":"<https://gcc.gnu.org/mailman/listinfo/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe>","Errors-To":"gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org"}},{"id":3680426,"web_url":"http://patchwork.ozlabs.org/comment/3680426/","msgid":"<bmm.h2v488uum8.gcc.gcc-TEST.redi.9.90.REVIEW@forge-stage.sourceware.org>","list_archive_url":null,"date":"2024-12-19T09:19:38","subject":"Re: [PATCH v1 0/3] libstdc++: Implement C++23 <flat_map> and\n <flat_set>","submitter":{"id":93210,"url":"http://patchwork.ozlabs.org/api/people/93210/","name":"Jonathan Wakely via Sourceware Forge","email":"forge-bot+redi@forge-stage.sourceware.org"},"content":"Jonathan Wakely (redi) <redi@gcc.gnu.org> requested changes to the code:\nJust a few minor comments this time, although the constructor constraints will be a bit tedious. Sorry for not noticing those sooner.\n\n\n--\nhttps://forge.sourceware.org/gcc/gcc-TEST/pulls/9#issuecomment-560","headers":{"Return-Path":"<gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org>","X-Original-To":["incoming@patchwork.ozlabs.org","gcc-patches@gcc.gnu.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","gcc-patches@gcc.gnu.org"],"Authentication-Results":["legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=2620:52:6:3111::32; helo=vm01.sourceware.org;\n envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org;\n receiver=patchwork.ozlabs.org)","sourceware.org; dmarc=none (p=none dis=none)\n header.from=forge-stage.sourceware.org","sourceware.org;\n spf=pass smtp.mailfrom=forge-stage.sourceware.org","server2.sourceware.org;\n arc=none smtp.remote-ip=38.145.34.39"],"Received":["from vm01.sourceware.org (vm01.sourceware.org\n [IPv6:2620:52:6:3111::32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g0wLd64gzz1yD5\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 20:24:08 +1000 (AEST)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 5695A4BB58C6\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 10:24:06 +0000 (GMT)","from forge-stage.sourceware.org (vm08.sourceware.org [38.145.34.39])\n by sourceware.org (Postfix) with ESMTPS id 73C674BAD14B\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 10:16:12 +0000 (GMT)","from forge-stage.sourceware.org (localhost [IPv6:::1])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256)\n (No client certificate requested)\n by forge-stage.sourceware.org (Postfix) with ESMTPS id 9AF1240574\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 10:16:04 +0000 (UTC)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org 5695A4BB58C6","OpenDKIM Filter v2.11.0 sourceware.org 73C674BAD14B"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org 73C674BAD14B","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org 73C674BAD14B","ARC-Seal":"i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776852972; cv=none;\n b=J5ToAHVW46pohzecoQrVX0ypigiaiWv791DRDGYPRUIdtGnJH1uGHzFG732I5Ejs5wmkCGpwxUmSNnOw/SCV3QwS31tme6OpyqFDdv5o3YMTd5AdXiA0BIIX9SdC2wMBbrMVCVCwI4NKPajtOOX0ZSSwg9rX+M5xF0pFS8CefZ4=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1776852972; c=relaxed/simple;\n bh=Imiw72wN9IhD/G9/4+VJ/JGkBSOuc2ZhVDy5TYkjGvM=;\n h=Subject:From:To:Date:Message-ID:MIME-Version;\n b=xPmu7ESWj1gJDl73ZteD6JGOdJ4SwZYC4vtlRlRXT2V7LEfk5yq1Fi7ab/GrRyOxP4haQA7/dbH0SrVMRDI3hnRFa8nKiexrxGfSX2OyFAKkSt00sYKX0Y9zVA2z9cSVtGoudlGXjNGUgRF5nli7tezXHE4+bXpsKnImJtwuIJ0=","ARC-Authentication-Results":"i=1; server2.sourceware.org","Subject":"Re: [PATCH v1 0/3] libstdc++: Implement C++23 <flat_map> and\n <flat_set>","From":"Jonathan Wakely via Sourceware Forge\n <forge-bot+redi@forge-stage.sourceware.org>","To":"gcc-patches mailing list <gcc-patches@gcc.gnu.org>","Date":"Thu, 19 Dec 2024 09:19:38 +0000","Message-ID":"\n <bmm.h2v488uum8.gcc.gcc-TEST.redi.9.90.REVIEW@forge-stage.sourceware.org>","In-Reply-To":"\n <bmm.hhuay3vzv6.gcc.gcc-TEST.ppalka.9.1.0@forge-stage.sourceware.org>","X-Mailer":"batrachomyomachia","X-Requested-Reviewer":"redi","X-Pull-Request-Organization":"gcc","X-Pull-Request-Repository":"gcc-TEST","X-Pull-Request":"https://forge.sourceware.org/gcc/gcc-TEST/pulls/9","X-Review":"https://forge.sourceware.org/gcc/gcc-TEST/pulls/9#issuecomment-560","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"quoted-printable","MIME-Version":"1.0","X-BeenThere":"gcc-patches@gcc.gnu.org","X-Mailman-Version":"2.1.30","Precedence":"list","List-Id":"Gcc-patches mailing list <gcc-patches.gcc.gnu.org>","List-Unsubscribe":"<https://gcc.gnu.org/mailman/options/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe>","List-Archive":"<https://gcc.gnu.org/pipermail/gcc-patches/>","List-Post":"<mailto:gcc-patches@gcc.gnu.org>","List-Help":"<mailto:gcc-patches-request@gcc.gnu.org?subject=help>","List-Subscribe":"<https://gcc.gnu.org/mailman/listinfo/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe>","Errors-To":"gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org"}},{"id":3680427,"web_url":"http://patchwork.ozlabs.org/comment/3680427/","msgid":"<bmm.h2v488uum8.gcc.gcc-TEST.redi.9.64.REVIEW@forge-stage.sourceware.org>","list_archive_url":null,"date":"2024-12-19T09:19:38","subject":"Re: [PATCH v1 0/3] libstdc++: Implement C++23 <flat_map> and\n <flat_set>","submitter":{"id":93210,"url":"http://patchwork.ozlabs.org/api/people/93210/","name":"Jonathan Wakely via Sourceware Forge","email":"forge-bot+redi@forge-stage.sourceware.org"},"content":"Jonathan Wakely (redi) <redi@gcc.gnu.org> requested changes to the code:\nPlease add `[[nodiscard]]` to key_comp, value_comp, keys, values, find, count, lower_bound, upper_bound, equal_range, contains, operator== and operator<=>\n\n\n--\nhttps://forge.sourceware.org/gcc/gcc-TEST/pulls/9#issuecomment-340","headers":{"Return-Path":"<gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org>","X-Original-To":["incoming@patchwork.ozlabs.org","gcc-patches@gcc.gnu.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","gcc-patches@gcc.gnu.org"],"Authentication-Results":["legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=2620:52:6:3111::32; helo=vm01.sourceware.org;\n envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org;\n receiver=patchwork.ozlabs.org)","sourceware.org; dmarc=none (p=none dis=none)\n header.from=forge-stage.sourceware.org","sourceware.org;\n spf=pass smtp.mailfrom=forge-stage.sourceware.org","server2.sourceware.org;\n arc=none smtp.remote-ip=38.145.34.39"],"Received":["from vm01.sourceware.org (vm01.sourceware.org\n [IPv6:2620:52:6:3111::32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g0wLh695sz1yD5\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 20:24:12 +1000 (AEST)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id E46834BB58A0\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 10:24:10 +0000 (GMT)","from forge-stage.sourceware.org (vm08.sourceware.org [38.145.34.39])\n by sourceware.org (Postfix) with ESMTPS id 23C4C4BAD15A\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 10:16:11 +0000 (GMT)","from forge-stage.sourceware.org (localhost [IPv6:::1])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256)\n (No client certificate requested)\n by forge-stage.sourceware.org (Postfix) with ESMTPS id D60E54056B\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 10:16:03 +0000 (UTC)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org E46834BB58A0","OpenDKIM Filter v2.11.0 sourceware.org 23C4C4BAD15A"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org 23C4C4BAD15A","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org 23C4C4BAD15A","ARC-Seal":"i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776852971; cv=none;\n b=aKvOUnAAP+/D21Sxv1EyPLKwgAb3np7lPxVBzm8E5ve5sUl2erixcJOC7umFJMg6cmZ7Dr43Q70CioaUM6iODFnYZ911fGO3EpHL+H/HNmcDukCzf6Ns9KjWjpws4GJuNQo+qjYMsY5/D/Bgye167eRNux1PG6vMc8NVWOu7qTM=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1776852971; c=relaxed/simple;\n bh=aswaCDJFVRX4UWp2LIyvoYBUNeuj7RU/KOphoJN1W8I=;\n h=Subject:From:To:Date:Message-ID:MIME-Version;\n b=rLCHaixSqQB8H9+YKxAcOIwvBjuWCWLloC0Qz92BdZkwiEqAIBIgODJwGpFeejuS4k8dGfKmerk/NlqrWABbrVnmwB0BCnscGrHNtj4yNNDviemgfaFNCJbWN6L/CUeaDOBi6fhfaThtRwTx8pInXYMaUB3RMo6W0tSwImUbIBU=","ARC-Authentication-Results":"i=1; server2.sourceware.org","Subject":"Re: [PATCH v1 0/3] libstdc++: Implement C++23 <flat_map> and\n <flat_set>","From":"Jonathan Wakely via Sourceware Forge\n <forge-bot+redi@forge-stage.sourceware.org>","To":"gcc-patches mailing list <gcc-patches@gcc.gnu.org>","Date":"Thu, 19 Dec 2024 09:19:38 +0000","Message-ID":"\n <bmm.h2v488uum8.gcc.gcc-TEST.redi.9.64.REVIEW@forge-stage.sourceware.org>","In-Reply-To":"\n <bmm.hhuay3vzv6.gcc.gcc-TEST.ppalka.9.1.0@forge-stage.sourceware.org>","X-Mailer":"batrachomyomachia","X-Requested-Reviewer":"redi","X-Pull-Request-Organization":"gcc","X-Pull-Request-Repository":"gcc-TEST","X-Pull-Request":"https://forge.sourceware.org/gcc/gcc-TEST/pulls/9","X-Review":"https://forge.sourceware.org/gcc/gcc-TEST/pulls/9#issuecomment-340","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"quoted-printable","MIME-Version":"1.0","X-BeenThere":"gcc-patches@gcc.gnu.org","X-Mailman-Version":"2.1.30","Precedence":"list","List-Id":"Gcc-patches mailing list <gcc-patches.gcc.gnu.org>","List-Unsubscribe":"<https://gcc.gnu.org/mailman/options/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe>","List-Archive":"<https://gcc.gnu.org/pipermail/gcc-patches/>","List-Post":"<mailto:gcc-patches@gcc.gnu.org>","List-Help":"<mailto:gcc-patches-request@gcc.gnu.org?subject=help>","List-Subscribe":"<https://gcc.gnu.org/mailman/listinfo/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe>","Errors-To":"gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org"}},{"id":3680428,"web_url":"http://patchwork.ozlabs.org/comment/3680428/","msgid":"<bmm.hhub14fq24.gcc.gcc-TEST.ppalka.9.1.SUMMARY@forge-stage.sourceware.org>","list_archive_url":null,"date":"2026-04-22T10:17:49","subject":"[SUMMARY] Re: [PATCH v1 0/3] libstdc++: Implement C++23 <flat_map>\n and <flat_set>","submitter":{"id":93215,"url":"http://patchwork.ozlabs.org/api/people/93215/","name":"ppalka via Sourceware Forge","email":"forge-bot+ppalka@forge-stage.sourceware.org"},"content":"This is a summary of discussions relative to the merge request created by (ppalka) <ppalka@gcc.gnu.org> titled\nlibstdc++: Implement C++23 <flat_map> and <flat_set>\nsince its creation.\n\nDescription: (See the individual commit messages.)\n\nThe full and up to date discussion can be found at https://forge.sourceware.org/gcc/gcc-TEST/pulls/9\n\nThe merge request has been closed without being merged directly on the forge repository.\n\nOn 2024-11-09 09:16:01+00:00, Jonathan Wakely (redi) <redi@gcc.gnu.org> requested changes to the code:\nSome quick comments on the tests. I'm still reviewing the implementations.\n\n> +++ libstdc++-v3/testsuite/23_containers/flat_multimap/1.cc\n> @@ -0,0 +99,4 @@\n> +int\n> +main()\n> +{\n> +  test01<std::vector>();\nMissing `#include <vector>`\n> +++ libstdc++-v3/testsuite/23_containers/flat_set/1.cc\n> @@ -0,0 +104,4 @@\n> +int\n> +main()\n> +{\n> +  test01<std::vector>();\nMissing `#include <vector>`\n> +++ libstdc++-v3/testsuite/23_containers/flat_set/1.cc\n> @@ -0,0 +31,4 @@\n> +      m.insert(m.end(), 0);\n> +      m.insert(m.end(), 1);\n> +      m.insert(m.end(), 2);\n> +      m.insert(m.end(), 3);\nIt might be better to insert these in a different order, to be confident they're being sorted correctly and not just preserving the order you inserted them.\n\nMaybe do:\n```\n      m.insert(m.end(), (0+i) % 4);\n      m.insert(m.end(), (1+i) % 4);\n      m.insert(m.end(), (2+i) % 4);\n      m.insert(m.end(), (3+i) % 4);\n```\nso they're inserted in a different order each time round the loop.\n\nYou could do the same for `flat_map/1.cc` too.\n> +++ libstdc++-v3/testsuite/23_containers/flat_set/1.cc\n> @@ -0,0 +31,4 @@\n> +      m.insert(m.end(), 0);\n> +      m.insert(m.end(), 1);\n> +      m.insert(m.end(), 2);\n> +      m.insert(m.end(), 3);\nFixed\n> +++ libstdc++-v3/testsuite/23_containers/flat_set/1.cc\n> @@ -0,0 +4,4 @@\n> +#include <deque>\n> +#include <testsuite_hooks.h>\n> +\n> +#if __cpp_lib_flat_set != 202207L\nI like to check the feature test macro after including the main header only, so put the includes for deque and testsuite_hooks.h (and vector) after checking the macro. That way we know it was set by flat_set not one of the others (even if the thing that's testing for is unlikely to ever be a problem, giving how our macros are implemented now).\n\nSame comment for the macro check in `flat_map/1.cc`\n> +++ libstdc++-v3/testsuite/23_containers/flat_map/1.cc\n> @@ -0,0 +116,4 @@\n> +int\n> +main()\n> +{\n> +  test01<std::vector>();\nMissing `#include <vector>` for this (I know it's included by your `<flat_map>` but it isn't necessarily required to be by the standard).\n\nOn 2024-11-09 09:38:02+00:00, Jonathan Wakely (redi) <redi@gcc.gnu.org> commented on the code:\n\n\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +144,4 @@\n> +\t\t     mapped_container_type __mapped_cont,\n> +\t\t     const key_compare& __comp = key_compare())\n> +      : _M_cont(std::move(__key_cont), std::move(__mapped_cont)), _M_comp(__comp)\n> +      { __glibcxx_assert(_M_cont.keys.size() == _M_cont.values.size()); }\nMaybe a debug mode check for the invariant?\n```\n_GLIBCXX_DEBUG_ASSERT(ranges::is_sorted(_M_cont.keys, _M_comp));\n```\n\n\nOn 2024-11-09 09:40:35+00:00, Jonathan Wakely (redi) <redi@gcc.gnu.org> commented on the code:\n\n\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +147,4 @@\n> +      { __glibcxx_assert(_M_cont.keys.size() == _M_cont.values.size()); }\n> +\n> +      template<typename _InputIterator,\n> +\t       typename = _RequireInputIter<_InputIterator>>\nUse a _requires-clause_ instead? (Similarly below)\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +147,4 @@\n> +      { __glibcxx_assert(_M_cont.keys.size() == _M_cont.values.size()); }\n> +\n> +      template<typename _InputIterator,\n> +\t       typename = _RequireInputIter<_InputIterator>>\nRewrote those constraints with\n\n`requires requires { typename _RequireInputIter<_InputIterator>; }`\n\nI guess we might want to factor this out into a suitably-named concept at some point.\n\nI also rewrote `_RequireNotAllocator<_Compare>` constraints in the deduction guides accordingly.\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +147,4 @@\n> +      { __glibcxx_assert(_M_cont.keys.size() == _M_cont.values.size()); }\n> +\n> +      template<typename _InputIterator,\n> +\t       typename = _RequireInputIter<_InputIterator>>\nI ended up defining new `__not_allocator_like` and `__has_input_iter_cat` concepts to get rid of all `typename = ...`-style constraints.\n\nOn 2024-11-09 09:43:56+00:00, Jonathan Wakely (redi) <redi@gcc.gnu.org> commented on the code:\n\n\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +41,4 @@\n> +#include <compare>\n> +#include <initializer_list>\n> +\n> +#include <algorithm>\nDo we need the whole of `<algorithm>`, `<functional>`, and `<ranges>`?\n\nPlease add `<bits/uses_allocator_args.h>` so that if we do trim the includes down later, we still explicitly include it for `make_obj_using_allocator`.\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +41,4 @@\n> +#include <compare>\n> +#include <initializer_list>\n> +\n> +#include <algorithm>\nIndeed we can replace `<algorithm>` with `<bits/stl_algo.h>` and `<bits/ranges_algo.h>`.\n\n`<flat_map>` needs `<ranges>` for `views::zip`, but `<flat_set>` doesn't need `<ranges>` at all, so we can at least remove it from the latter header.\n\nBoth headers need `<functional>` for `std::not_fn`.\n\nAdded explicit `<bits/uses_allocator_args.h>`.\n\nOn 2024-11-09 09:56:05+00:00, Jonathan Wakely (redi) <redi@gcc.gnu.org> commented on the code:\n\n\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +231,4 @@\n> +      template<typename _Alloc>\n> +\t_Flat_map_impl(const _Derived& __x, const _Alloc& __a)\n> +\t: _M_comp(__x._M_comp),\n> +\t  _M_cont(std::make_obj_using_allocator<containers>(__a, __x._M_cont))\nI don't think this will use uses-allocator construction. `containers` has no constructors, so `is_constructible_v<containers, const Alloc&>` is false, so it won't pass the allocator to the `keys` and `values` subobjects.\n\nI think you need to construct `_M_cont` using aggregate-initialization from two containers, each individually constructed with uses-allocator construction, similar to line 227.\n\nDitto for line 240, that won't use the allocator either.\n\nThis suggests missing tests for the allocator constructors. `<testsuite_allocator.h>` has `uneq_allocator` which has an integer \"personality\". You can use that to verify that the `keys` and `values` constructed here use the allocator passed to the constructor, rather than copying the ones from `__x`\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +231,4 @@\n> +      template<typename _Alloc>\n> +\t_Flat_map_impl(const _Derived& __x, const _Alloc& __a)\n> +\t: _M_comp(__x._M_comp),\n> +\t  _M_cont(std::make_obj_using_allocator<containers>(__a, __x._M_cont))\nD'oh, fixed and added tests for these allocator constructors (at least the non-delegating ones)\n\nOn 2024-11-09 10:27:56+00:00, Jonathan Wakely (redi) <redi@gcc.gnu.org> commented on the code:\n\n\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +406,4 @@\n> +\t\t{\n> +\t\t  if (__s == 0) // hint[0] < k\n> +\t\t    // Insert before the leftmost equivalent key.\n> +\t\t    __key_it = std::lower_bound(__first, __last, __k, _M_comp);\nCan this be `lower_bound(__hint, __last, __k, _M_comp)`?\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +406,4 @@\n> +\t\t{\n> +\t\t  if (__s == 0) // hint[0] < k\n> +\t\t    // Insert before the leftmost equivalent key.\n> +\t\t    __key_it = std::lower_bound(__first, __last, __k, _M_comp);\nmaybe also have a branch for the `s == 1` case and use `lower_bound(__first, __hint, __k, _M_comp)`?\n\nI haven't checked if that actually works (e.g. if the hint is already in the middle of a group of keys equivalent to k), just seems at first glance like `s != -1` means we've already partitioned the range into [first, hint) and [hint,last) and don't need to bisect the whole of [first,last) again.\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +406,4 @@\n> +\t\t{\n> +\t\t  if (__s == 0) // hint[0] < k\n> +\t\t    // Insert before the leftmost equivalent key.\n> +\t\t    __key_it = std::lower_bound(__first, __last, __k, _M_comp);\n> just seems at first glance like s != -1 means we've already partitioned the range into [first, hint) and [hint,last) and don't need to bisect the whole of [first,last) again.\n\nIndeed, that's the intent of the code just before that block (which considers `__r` instead of `__s` but the formulations should be equivalent since `__r != -1` iff `__s != -1 && __hint->_M_index != 0`(?)).\n\n```cpp\nif (__r == 1) // k >= hint[-1]\n  __first += __hint->_M_index;\nelse if (__r == 0) // k < __hint[-1]\n  __last = __first + __hint->_M_index;\n```\n \n For `flat_map` this should be purely an optimization but for `flat_multimap` it's also a correctness issue (at least the `__r == 1` case is) since we need to insert the given key immediately before `__hint` and there could be multiple keys equivalent to `__hint`.\n\nOn 2024-11-09 10:37:27+00:00, Jonathan Wakely (redi) <redi@gcc.gnu.org> commented on the code:\n\n\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +421,4 @@\n> +\t    if (__key_it != _M_cont.keys.end() && !_M_comp(__k, __key_it[0]))\n> +\t      return {iterator{this, __key_it}, false};\n> +\n> +\t  __key_it = _M_cont.keys.insert(__key_it, std::move(__k));\nIf this insertion throws, we don't know what state `_M_cont.keys` is in. An arbitrary user-defined sequence might not give strong exception safety here. So basically if any insertion throws, we need to call `clear()` before returning.\n\nWe can do a special case for `std::vector` in _some_ places, and maybe for `vector<NothrowMoveInsertable>` here (so we know only the re-allocation can throw, and if that happens then `_M_cont.keys` will be unchanged). But in general, we need to `clear()` after any modification of `_M_cont.keys` or `_M_cont.values` that throws. `flat_map` is lossy on throwing operations.\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +421,4 @@\n> +\t    if (__key_it != _M_cont.keys.end() && !_M_comp(__k, __key_it[0]))\n> +\t      return {iterator{this, __key_it}, false};\n> +\n> +\t  __key_it = _M_cont.keys.insert(__key_it, std::move(__k));\nSpecial case optimizations for `vector<NothrowMoveInsertable>` can be added later though. Just getting the general case right for now is good enough.\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +421,4 @@\n> +\t    if (__key_it != _M_cont.keys.end() && !_M_comp(__k, __key_it[0]))\n> +\t      return {iterator{this, __key_it}, false};\n> +\n> +\t  __key_it = _M_cont.keys.insert(__key_it, std::move(__k));\nAh, I think I wrongly assumed the exception guarantees in https://eel.is/c++draft/container.requirements#container.reqmts-66 hold for any container that a user wants to adapt with `flat_map/set`, even a user-defined one.  Fixed this code path to clear both containers upon encountering an exception (with the help of a new RAII helper).\n\nOn 2024-11-09 10:59:34+00:00, Jonathan Wakely (redi) <redi@gcc.gnu.org> commented on the code:\n\n\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +429,4 @@\n> +\t    }\n> +\t  __catch(...)\n> +\t    {\n> +\t      _M_cont.keys.erase(__key_it);\nIf inserting into `values` throws, it might now have a different number of elements to `keys`, e.g. it could have already inserted an element at the end and be in the process of rotating all the existing elements to put it in the correct place (a not-unreasonable implementation strategy for a user-defined sequence). If one of the swaps done by the rotation throws, then `values` is left with more elements than `keys`. We have to `clear()`, there's no other way to be sure the map's invariants hold.\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +429,4 @@\n> +\t    }\n> +\t  __catch(...)\n> +\t    {\n> +\t      _M_cont.keys.erase(__key_it);\nAha, should now be fixed by unconditionally clearing both containers upon exception in that code block.\n\nOn 2024-11-09 11:03:44+00:00, Jonathan Wakely (redi) <redi@gcc.gnu.org> commented on the code:\n\n\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +378,4 @@\n> +      // modifiers\n> +      template<typename _Key2, typename... _Args>\n> +\tpair<iterator, bool>\n> +\t_M_try_emplace(optional<const_iterator> __hint, _Key2&& __k, _Args&&... __args)\nI'm not wild about using `optional` for the hint, as `optional` is sadly quite computationally expensive (although a bit better since 9ed070220ec1c837149f7b2eff7227f2e6b503e3). But only having a single function to implement all insertion operations does simplify things... if it meets all the requirements.\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +378,4 @@\n> +      // modifiers\n> +      template<typename _Key2, typename... _Args>\n> +\tpair<iterator, bool>\n> +\t_M_try_emplace(optional<const_iterator> __hint, _Key2&& __k, _Args&&... __args)\nI tried to replace the use of `optional` here but couldn't arrive at anything I was happy with unfortunately\n\nOn 2024-11-09 11:14:32+00:00, Jonathan Wakely (redi) <redi@gcc.gnu.org> commented on the code:\n\n\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +512,4 @@\n> +\t      _M_cont.keys.emplace_back(std::move(__value.first));\n> +\t      _M_cont.values.emplace_back(std::move(__value.second));\n> +\t    }\n> +\t  _M_sort_uniq();\nWe need a try-catch around all this, otherwise any failed insertion into `values` leaves us with `keys.size() != values.size(), and a failed insertion into `keys` or an exception constructing `__value` leaves us unsorted.\n\nI think you probably want a really simple RAII guard type that is used in multiple places:\n\n```\nstruct _KillEmAll {\n  ~_KillEmAll() { if (_M_map) _M_map->clear(); }\n  _Flat_map_impl* _M_map;\n};\n```\n(better name TBD)\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +512,4 @@\n> +\t      _M_cont.keys.emplace_back(std::move(__value.first));\n> +\t      _M_cont.values.emplace_back(std::move(__value.second));\n> +\t    }\n> +\t  _M_sort_uniq();\nOh, exactly like you have on line 540. But it's needed in multiple places, so defined it at class scope.\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +512,4 @@\n> +\t      _M_cont.keys.emplace_back(std::move(__value.first));\n> +\t      _M_cont.values.emplace_back(std::move(__value.second));\n> +\t    }\n> +\t  _M_sort_uniq();\nShould now be fixed\n\nOn 2024-11-09 11:16:29+00:00, Jonathan Wakely (redi) <redi@gcc.gnu.org> commented on the code:\n\n\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +552,4 @@\n> +      replace(key_container_type&& __key_cont, mapped_container_type&& __mapped_cont)\n> +      {\n> +\t__glibcxx_assert(__key_cont.size() == __mapped_cont.size());\n> +\t__try\nCan use the RAII guard here too.\n\nOn 2024-11-09 11:17:55+00:00, Jonathan Wakely (redi) <redi@gcc.gnu.org> commented on the code:\n\n\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +576,4 @@\n> +      {\n> +\tauto __idx = __position._M_index;\n> +\tauto __it = _M_cont.keys.erase(_M_cont.keys.begin() + __idx);\n> +\t_M_cont.values.erase(_M_cont.values.begin() + __idx);\nI think this has to clear() on an exception as well. Erasing from either container could throw while shuffling elements around, which would leave the relative number or order of elements inconsistent.\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +576,4 @@\n> +      {\n> +\tauto __idx = __position._M_index;\n> +\tauto __it = _M_cont.keys.erase(_M_cont.keys.begin() + __idx);\n> +\t_M_cont.values.erase(_M_cont.values.begin() + __idx);\nFixed\n\nOn 2024-11-09 11:19:51+00:00, Jonathan Wakely (redi) <redi@gcc.gnu.org> commented on the code:\n\n\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +604,4 @@\n> +\tauto __it = _M_cont.keys.erase(_M_cont.keys.begin() + __first._M_index,\n> +\t\t\t\t       _M_cont.keys.begin() + __last._M_index);\n> +\t_M_cont.values.erase(_M_cont.values.begin() + __first._M_index,\n> +\t\t\t     _M_cont.values.begin() + __last._M_index);\nclear on exception\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +604,4 @@\n> +\tauto __it = _M_cont.keys.erase(_M_cont.keys.begin() + __first._M_index,\n> +\t\t\t\t       _M_cont.keys.begin() + __last._M_index);\n> +\t_M_cont.values.erase(_M_cont.values.begin() + __first._M_index,\n> +\t\t\t     _M_cont.values.begin() + __last._M_index);\nFixed\n\nOn 2024-11-09 11:23:12+00:00, Jonathan Wakely (redi) <redi@gcc.gnu.org> commented on the code:\n\n\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +613,4 @@\n> +      {\n> +\tusing std::swap;\n> +\tswap(_M_cont, __x._M_cont);\n> +\tswap(_M_comp, __x._M_comp);\nThis doesn't swap `_M_comp`. At least we don't need to worry about exceptions, because it's `noexcept`!\n\nThe spec says to use `ranges::swap(keys, __x.keys)` and `ranges::swap(values, y.values)`, I don't remember why. \n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +613,4 @@\n> +      {\n> +\tusing std::swap;\n> +\tswap(_M_cont, __x._M_cont);\n> +\tswap(_M_comp, __x._M_comp);\nApparently I can't read, I thought this was swapping keys and then values, but it's swapping _M_cont and then _M_comp. Oops.\n\nBut I think that's wrong. `swap(cont, x.cont)` will use the generic `std::swap` that does move construction+assignments, which won't use any ADL swap for the container. Using `swap(cont.keys, x.cont.keys); swap(cont.values, x.cont.values);` will find custom swaps.\n\nI guess using `swap` unqualified after `using std::swap` is fine, because that's what `ranges::swap` would do (since these aren't arrays).\n\n\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +613,4 @@\n> +      {\n> +\tusing std::swap;\n> +\tswap(_M_cont, __x._M_cont);\n> +\tswap(_M_comp, __x._M_comp);\nFixed to just use `ranges::swap` here.\n\nOn 2024-11-09 11:27:48+00:00, Jonathan Wakely (redi) <redi@gcc.gnu.org> commented on the code:\n\n\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +630,4 @@\n> +\n> +      value_compare\n> +      value_comp() const\n> +      { return value_compare(key_comp()); }\ncould use `_M_comp` instead of `key_comp()` to save a call.\n\nOn 2024-11-09 11:31:57+00:00, Jonathan Wakely (redi) <redi@gcc.gnu.org> commented on the code:\n\n\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +683,4 @@\n> +\tcount(const _Key2& __x) const\n> +\t{\n> +\t  if constexpr (!_Multi && same_as<_Key2, _Key>)\n> +\t    return contains(__x);\nCould you drop the `same_as` condition and use `contains<_Key2>(__x)`?\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +683,4 @@\n> +\tcount(const _Key2& __x) const\n> +\t{\n> +\t  if constexpr (!_Multi && same_as<_Key2, _Key>)\n> +\t    return contains(__x);\nGood point, I don't see why not! Fixed.\n\nOn 2024-11-09 11:33:03+00:00, Jonathan Wakely (redi) <redi@gcc.gnu.org> commented on the code:\n\n\n\nOn 2024-11-09 11:39:59+00:00, Jonathan Wakely (redi) <redi@gcc.gnu.org> commented on the code:\n\n\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +722,4 @@\n> +      template<typename _Key2>\n> +\trequires same_as<_Key2, _Key> || __transparent_comparator<_Compare>\n> +\tconst_iterator\n> +\tlower_bound(const _Key2& __x) const\nIt's annoying that we can't use \"deducing this\" for these pairs of const/non-const overloads, but the return types make it awkward. We could do:\n```c++\ntemplate<typename T>\nusing __iter = __conditional_t<is_const_v<T>, const_iterator, iterator>;\n\ntemplate<typename Self, typename K2>\nrequires ...\n__iter<Self>\nlower_bound(this Self& self, const K2& k)\n{\n    auto __it = std::lower_bound(_M_cont.keys.begin(), _M_cont.keys.end(),\n\t\t\t\t       __x, _M_comp);\n    return {this, __it};\n}\n```\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +722,4 @@\n> +      template<typename _Key2>\n> +\trequires same_as<_Key2, _Key> || __transparent_comparator<_Compare>\n> +\tconst_iterator\n> +\tlower_bound(const _Key2& __x) const\nAnd then we'd need to uglify the member accesses into `__like_t<_Self&, _Flat_map_impl>(self)._M_cont` etc, so doesn't seem worth it unfortunately \n\nOn 2024-11-09 11:40:56+00:00, Jonathan Wakely (redi) <redi@gcc.gnu.org> commented on the code:\n\n\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +818,4 @@\n> +\t    }\n> +\t  __catch(...)\n> +\t    {\n> +\t      __c.clear();\nRAII guard instead?\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +818,4 @@\n> +\t    }\n> +\t  __catch(...)\n> +\t    {\n> +\t      __c.clear();\nFixed\n\nOn 2024-11-09 11:43:40+00:00, Jonathan Wakely (redi) <redi@gcc.gnu.org> commented on the code:\n\n\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +828,4 @@\n> +      [[no_unique_address]] _Compare _M_comp;\n> +\n> +      void\n> +      _M_sort_uniq()\nIf this (or _M_unique) throws then invariants might be broken, but I think it's OK to ignore that here and leave callers to be responsible for doing clear()\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +828,4 @@\n> +      [[no_unique_address]] _Compare _M_comp;\n> +\n> +      void\n> +      _M_sort_uniq()\nAh, especially because _M_sort_uniq is used from constructors, so it would be useless for _M_sort_uniq to call clear() when there's no object left to care about its invariants.\n\nOn 2024-11-09 11:44:54+00:00, Jonathan Wakely (redi) <redi@gcc.gnu.org> commented on the code:\n\n\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +881,4 @@\n> +\n> +      reference\n> +      operator*() const noexcept\n> +      { return {_M_cont->keys[_M_index], _M_cont->values[_M_index]}; }\n`__glibcxx_assert(_M_index < _M_cont.size());`\n\nOn 2024-11-09 11:48:56+00:00, Jonathan Wakely (redi) <redi@gcc.gnu.org> requested changes to the code:\nPlease add `[[nodiscard]]` to key_comp, value_comp, keys, values, find, count, lower_bound, upper_bound, equal_range, contains, operator== and operator<=>\n\n\nOn 2024-11-09 11:53:32+00:00, Jonathan Wakely (redi) <redi@gcc.gnu.org> commented on the code:\n\n\n> +++ libstdc++-v3/include/std/flat_set\n> @@ -0,0 +257,4 @@\n> +      operator=(initializer_list<value_type> __il)\n> +      {\n> +\tclear();\n> +\tinsert(__il);\nInstead of clear+insert I think you can just do `_M_cont = __il`, which is part of the general container requirements.\n\nFor some containers `clear()` deallocates all the storage and then `insert(il)` would have to reallocate, e.g. `deque`. But assigning the list directly can reuse existing elements.\n> +++ libstdc++-v3/include/std/flat_set\n> @@ -0,0 +257,4 @@\n> +      operator=(initializer_list<value_type> __il)\n> +      {\n> +\tclear();\n> +\tinsert(__il);\nSounds good.  In that case we need a clear guard, and call `_M_sort_uniq` afterwards since the initializer list elements aren't necessarily sorted/deduped IIUC.\n\nOn 2024-11-09 11:55:40+00:00, Jonathan Wakely (redi) <redi@gcc.gnu.org> commented on the code:\n\n\n> +++ libstdc++-v3/include/std/flat_set\n> @@ -0,0 +409,4 @@\n> +\t{\n> +\t  auto __it = _M_cont.insert(_M_cont.end(), __first, __last);\n> +\t  std::sort(__it, _M_cont.end(), _M_comp);\n> +\t  std::inplace_merge(_M_cont.begin(), __it, _M_cont.end(), _M_comp);\nflat set is much less eager to drop all your data on the floor than flat map, but I think for this member function it does need to clear() if anything throws. Otherwise if even one element has been inserted, we don't know if the order of elements is valid.\n> +++ libstdc++-v3/include/std/flat_set\n> @@ -0,0 +409,4 @@\n> +\t{\n> +\t  auto __it = _M_cont.insert(_M_cont.end(), __first, __last);\n> +\t  std::sort(__it, _M_cont.end(), _M_comp);\n> +\t  std::inplace_merge(_M_cont.begin(), __it, _M_cont.end(), _M_comp);\nMakes sense, fixed\n\nOn 2024-11-09 11:57:07+00:00, Jonathan Wakely (redi) <redi@gcc.gnu.org> commented on the code:\n\n\n> +++ libstdc++-v3/include/std/flat_set\n> @@ -0,0 +450,4 @@\n> +\n> +      void\n> +      replace(container_type&& __cont)\n> +      {\n`_GLIBCXX_DEBUG_ASSERT(ranges::is_sorted(__cont, _M_comp));`\n\n\nOn 2024-12-17 03:29:12+00:00, (ppalka) wrote:\n\nUpdated with hopefully all review comments addressed.  The from_range_t constructors and guides are now also implemented.\n\n\nOn 2024-12-18 18:57:13+00:00, Jonathan Wakely (redi) wrote:\n\nI think we want these added to `src/c++23/std.cc.in`\n\nOn 2024-12-18 19:16:59+00:00, Jonathan Wakely (redi) <redi@gcc.gnu.org> commented on the code:\n\n\n> +++ libstdc++-v3/testsuite/23_containers/flat_multimap/1.cc\n> @@ -0,0 +10,4 @@\n> +void\n> +test01()\n> +{\n> +  std::flat_multimap<int, int, std::less<int>, Sequence<int>, Sequence<int>> m;\nIt would be good to test that using two different sequence types works, just to be sure there are no accidental mixups between `key_container::iterator` and `mapped_container::iterator` in the implementation.\n\nOn 2024-12-18 20:28:42+00:00, Jonathan Wakely (redi) <redi@gcc.gnu.org> commented on the code:\n\n\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +213,4 @@\n> +      : _Flat_map_impl(__s, __il.begin(), __il.end(), __comp)\n> +      { }\n> +\n> +      // constructors with allocators\n[flat.map.cons.alloc]:\n\n>  The constructors in this subclause shall not participate in overload resolution unless `uses_allocator_v<key_container_type, Alloc>` is true and `uses_allocator_v<mapped_container_type, Alloc>` is true.\n\nSo the allocator-extended constructors need to be constrained.\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +213,4 @@\n> +      : _Flat_map_impl(__s, __il.begin(), __il.end(), __comp)\n> +      { }\n> +\n> +      // constructors with allocators\nAnd there's similar wording for flat_multimap, flat_set and flat_multiset of course.\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +213,4 @@\n> +      : _Flat_map_impl(__s, __il.begin(), __il.end(), __comp)\n> +      { }\n> +\n> +      // constructors with allocators\nOops, will do.  Should we also constrain the allocator-aware deduction guides the same way?  Right now they're constrained with effectively `_RequireAllocator<_Alloc>`, but that's a strictly weaker constraint IIUC.\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +213,4 @@\n> +      : _Flat_map_impl(__s, __il.begin(), __il.end(), __comp)\n> +      { }\n> +\n> +      // constructors with allocators\nAh yes, see [container.adaptors.general] p6 (6.5), (6.6), (6.8)\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +213,4 @@\n> +      : _Flat_map_impl(__s, __il.begin(), __il.end(), __comp)\n> +      { }\n> +\n> +      // constructors with allocators\nack (looks like the deduction guides for `stack`/`queue`/`priority_queue` might need tweaking as well)\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +213,4 @@\n> +      : _Flat_map_impl(__s, __il.begin(), __il.end(), __comp)\n> +      { }\n> +\n> +      // constructors with allocators\nMissing constraints on the allocator ctors and deduction guides should be fixed, modulo the http://eel.is/c++draft/container.adaptors.general#6.7 constraint (which seems to be missing in our other standard container adaptors as well).\nThat constraint seems like it's better suited on the class template rather than on the deduction guides?\n\nOn 2024-12-18 20:34:41+00:00, Jonathan Wakely (redi) <redi@gcc.gnu.org> commented on the code:\n\n\n> +++ libstdc++-v3/include/std/flat_set\n> @@ -0,0 +463,4 @@\n> +\t{\n> +\t  auto __guard = _M_make_clear_guard();\n> +\t  auto __it = _M_cont.insert(_M_cont.end(), __first, __last);\n> +\t  std::inplace_merge(_M_cont.begin(), __it, _M_cont.end(), _M_comp);\nThis will fail for non-common ranges, but needs `ranges::inplace_merge` to be fixed, right? Maybe add a FIXME or TODO comment.\n> +++ libstdc++-v3/include/std/flat_set\n> @@ -0,0 +463,4 @@\n> +\t{\n> +\t  auto __guard = _M_make_clear_guard();\n> +\t  auto __it = _M_cont.insert(_M_cont.end(), __first, __last);\n> +\t  std::inplace_merge(_M_cont.begin(), __it, _M_cont.end(), _M_comp);\nAren't  containers' `end()` required to  an `iterator` so that they're effectively always common ranges?\n> +++ libstdc++-v3/include/std/flat_set\n> @@ -0,0 +463,4 @@\n> +\t{\n> +\t  auto __guard = _M_make_clear_guard();\n> +\t  auto __it = _M_cont.insert(_M_cont.end(), __first, __last);\n> +\t  std::inplace_merge(_M_cont.begin(), __it, _M_cont.end(), _M_comp);\nOops yes, not sure what I was thinking. You've already inserted the range and the merge is only operating on the container's iterators.\n\nOn 2024-12-18 20:35:09+00:00, Jonathan Wakely (redi) <redi@gcc.gnu.org> requested changes to the code:\nJust a few minor comments this time, although the constructor constraints will be a bit tedious. Sorry for not noticing those sooner.\n\n\n\nOn 2024-12-19 06:20:06+00:00, (ppalka) wrote:\n\nUpdated with the latest review comments addressed I think\n\nOn 2024-12-19 06:25:38+00:00, (ppalka) <ppalka@gcc.gnu.org> commented on the code:\n\n\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +138,4 @@\n> +\t  if (_M_cont)\n> +\t    {\n> +\t      _M_cont->keys.clear();\n> +\t      _M_cont->values.clear();\nConsider this simplified to just do `_M_cont->clear();`\n\nOn 2024-12-19 06:31:11+00:00, (ppalka) <ppalka@gcc.gnu.org> commented on the code:\n\n\n> +++ libstdc++-v3/src/c++23/std.cc.in\n> @@ -1266,0 +1270,4 @@\n> +  using std::sorted_equivalent;\n> +  using std::sorted_equivalent_t;\n> +  using std::sorted_unique;\n> +  using std::sorted_unique_t;\nOops I could've sworn I exported `flat_multimap` too, consider that fixed.\n\nAnd it seems the `sorted_foo` types are defined in both `<flat_map>` and `<flat_set>`, so I reflected that here.\n> +++ libstdc++-v3/src/c++23/std.cc.in\n> @@ -1266,0 +1270,4 @@\n> +  using std::sorted_equivalent;\n> +  using std::sorted_equivalent_t;\n> +  using std::sorted_unique;\n> +  using std::sorted_unique_t;\nflat_multiset was missing too\n\nOn 2024-12-19 09:19:38+00:00, Jonathan Wakely (redi) <redi@gcc.gnu.org> approved the changes:\n\n\n\n\nOn 2024-12-19 16:35:08+00:00, (ppalka) wrote:\n\nThanks a lot! Pushed to trunk as r15-{6370,6371,6372}.\n\n\nOn 2026-04-22 10:15:33+00:00, Lichenor Forgejo Bot (forge-bot) wrote:\n\n<!-- pr-new-version -->\nVersion 1 of this pull request has been stored. It includes the following commits:\n- libstdc++: Implement P1206R7 range-key-type and range-mapped-type helpers - 891503b8b697daebb5bada203a1e08ff31a4887b\n- libstdc++: Implement C++23 <flat_map> (P0429R9) - f067bf07a92ad0984fcb52368fc37e880e05997e\n- libstdc++: Implement C++23 <flat_set> (P1222R4) - b564cb690469527d0825f7303ac8275ed19206d0\n\n\n\nOn 2026-04-22 10:15:59+00:00, Lichenor Forgejo Bot (forge-bot) wrote:\n\nSent patch series version 1 containing 3 patches to gcc-patches mailing list <gcc-patches@gcc.gnu.org>.\n[Cover letter](https://inbox.sourceware.org/gcc-patches/bmm.hhuay3vzv6.gcc.gcc-TEST.ppalka.9.1.0@forge-stage.sourceware.org)","headers":{"Return-Path":"<gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org>","X-Original-To":["incoming@patchwork.ozlabs.org","gcc-patches@gcc.gnu.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","gcc-patches@gcc.gnu.org"],"Authentication-Results":["legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=2620:52:6:3111::32; helo=vm01.sourceware.org;\n envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org;\n receiver=patchwork.ozlabs.org)","sourceware.org; dmarc=none (p=none dis=none)\n header.from=forge-stage.sourceware.org","sourceware.org;\n spf=pass smtp.mailfrom=forge-stage.sourceware.org","server2.sourceware.org;\n arc=none smtp.remote-ip=38.145.34.39"],"Received":["from vm01.sourceware.org (vm01.sourceware.org\n [IPv6:2620:52:6:3111::32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g0wM26nh9z1yD5\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 20:24:30 +1000 (AEST)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 86CA04BB3B89\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 10:24:28 +0000 (GMT)","from forge-stage.sourceware.org (vm08.sourceware.org [38.145.34.39])\n by sourceware.org (Postfix) with ESMTPS id 524294BA900F\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 10:17:49 +0000 (GMT)","from forge-stage.sourceware.org (localhost [IPv6:::1])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256)\n (No client certificate requested)\n by forge-stage.sourceware.org (Postfix) with ESMTPS id 2C8FA40553\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 10:17:49 +0000 (UTC)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org 86CA04BB3B89","OpenDKIM Filter v2.11.0 sourceware.org 524294BA900F"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org 524294BA900F","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org 524294BA900F","ARC-Seal":"i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776853069; cv=none;\n b=M9Y6fUYVsAupjvDU6V/WGKhuiPUWUmN9a1797zzoer1dYsQrV5BOjFJcflMwf0X91n6A2J6sbwsKNSfQQBPnFXafx+RpuO8G3TKvj5jF+WOAXex03Y9hdWq8jTJQV2APL9oLccP8p8Af9sc7ftwW9HbEEUbo7VQGlTHzHg/Th7Y=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1776853069; c=relaxed/simple;\n bh=jqAVtJwS/h7seyR9KHfNHrqtSUgVXjiRA2Ntq5itmt4=;\n h=Subject:From:To:Message-ID:MIME-Version:Date;\n b=A0cpVKQHqDwXg4Vy95/T/eqBeP4lbzXFJfego2PQ5SYJSAoGp313qW1SD6qGVW/jJtgmALUBLiqD8CxrWW6W5B1mi15BXFwhMTMZvtnHHzfFx7FYaaTpXNm6Pb5zuZ9no5iQoektHCw+Uc9Eq9kqw11GWzloAmJzaoMKMbhcmJg=","ARC-Authentication-Results":"i=1; server2.sourceware.org","Subject":"[SUMMARY] Re: [PATCH v1 0/3] libstdc++: Implement C++23 <flat_map>\n and <flat_set>","From":"ppalka via Sourceware Forge\n <forge-bot+ppalka@forge-stage.sourceware.org>","To":"gcc-patches mailing list <gcc-patches@gcc.gnu.org>","In-Reply-To":"\n <bmm.hhuay3vzv6.gcc.gcc-TEST.ppalka.9.1.0@forge-stage.sourceware.org>","Message-ID":"\n <bmm.hhub14fq24.gcc.gcc-TEST.ppalka.9.1.SUMMARY@forge-stage.sourceware.org>","X-Mailer":"batrachomyomachia","X-Requested-Reviewer":"redi","X-Pull-Request-Organization":"gcc","X-Pull-Request-Repository":"gcc-TEST","X-Pull-Request":"https://forge.sourceware.org/gcc/gcc-TEST/pulls/9","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"quoted-printable","MIME-Version":"1.0","Date":"Wed, 22 Apr 2026 10:17:49 +0000 (UTC)","X-BeenThere":"gcc-patches@gcc.gnu.org","X-Mailman-Version":"2.1.30","Precedence":"list","List-Id":"Gcc-patches mailing list <gcc-patches.gcc.gnu.org>","List-Unsubscribe":"<https://gcc.gnu.org/mailman/options/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe>","List-Archive":"<https://gcc.gnu.org/pipermail/gcc-patches/>","List-Post":"<mailto:gcc-patches@gcc.gnu.org>","List-Help":"<mailto:gcc-patches-request@gcc.gnu.org?subject=help>","List-Subscribe":"<https://gcc.gnu.org/mailman/listinfo/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe>","Errors-To":"gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org"}},{"id":3680429,"web_url":"http://patchwork.ozlabs.org/comment/3680429/","msgid":"<bmm.h1n4wldn0g.gcc.gcc-TEST.redi.9.67.REVIEW@forge-stage.sourceware.org>","list_archive_url":null,"date":"2024-11-09T11:57:07","subject":"Re: [PATCH v1 0/3] libstdc++: Implement C++23 <flat_map> and\n <flat_set>","submitter":{"id":93210,"url":"http://patchwork.ozlabs.org/api/people/93210/","name":"Jonathan Wakely via Sourceware Forge","email":"forge-bot+redi@forge-stage.sourceware.org"},"content":"Jonathan Wakely (redi) <redi@gcc.gnu.org>) commented on the code:\n\n\n> +++ libstdc++-v3/include/std/flat_set\n> @@ -0,0 +450,4 @@\n> +\n> +      void\n> +      replace(container_type&& __cont)\n> +      {\n`_GLIBCXX_DEBUG_ASSERT(ranges::is_sorted(__cont, _M_comp));`\n\n\n--\nhttps://forge.sourceware.org/gcc/gcc-TEST/pulls/9#issuecomment-346","headers":{"Return-Path":"<gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org>","X-Original-To":["incoming@patchwork.ozlabs.org","gcc-patches@gcc.gnu.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","gcc-patches@gcc.gnu.org"],"Authentication-Results":["legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=2620:52:6:3111::32; helo=vm01.sourceware.org;\n envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org;\n receiver=patchwork.ozlabs.org)","sourceware.org; dmarc=none (p=none dis=none)\n header.from=forge-stage.sourceware.org","sourceware.org;\n spf=pass smtp.mailfrom=forge-stage.sourceware.org","server2.sourceware.org;\n arc=none smtp.remote-ip=38.145.34.39"],"Received":["from vm01.sourceware.org (vm01.sourceware.org\n [IPv6:2620:52:6:3111::32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g0wMC1Kjtz1yD5\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 20:24:39 +1000 (AEST)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 9A5D64BB3BCE\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 10:24:36 +0000 (GMT)","from forge-stage.sourceware.org (vm08.sourceware.org [38.145.34.39])\n by sourceware.org (Postfix) with ESMTPS id 5FA024BAD177\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 10:16:11 +0000 (GMT)","from forge-stage.sourceware.org (localhost [IPv6:::1])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256)\n (No client certificate requested)\n by forge-stage.sourceware.org (Postfix) with ESMTPS id 26A5D4056E\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 10:16:04 +0000 (UTC)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org 9A5D64BB3BCE","OpenDKIM Filter v2.11.0 sourceware.org 5FA024BAD177"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org 5FA024BAD177","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org 5FA024BAD177","ARC-Seal":"i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776852971; cv=none;\n b=Zbvslb48N/DX5Eo9FSSqe/Vv9eMjZhLHxEmEQp7U2/FA6Xh/v9e6OE27df4+JnE+yeGA6o+9G2e9MO6pD1eglZCTI92yziZBRJeX+uHruzDa8YL2uprpifZ77jKBtZAgLPgN41zgymRLzhZqa0x8/vyZMP/1aR4j18Kwfqjp+a8=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1776852971; c=relaxed/simple;\n bh=gwnVYcP1nB+3LvYebwXyH0Dlp5V9hT7pbPQHXpehbyY=;\n h=Subject:From:To:Date:Message-ID:MIME-Version;\n b=wiOJf/NVeNg95jEBG8PGbYhN8HCXyW9RvekrP3uJcEDoD5mlAqH+OKScgvkOqdczoaPnFxLQWzPVxGy+6tb+w5FFEx5vuyriZ1YWkDGSRINBFnjNl46IY7Ce1mgJeWU8hWBF7jki7piAroSxWgxr7CR4jfjBuYsjAXrIQSLN+yo=","ARC-Authentication-Results":"i=1; server2.sourceware.org","Subject":"Re: [PATCH v1 0/3] libstdc++: Implement C++23 <flat_map> and\n <flat_set>","From":"Jonathan Wakely via Sourceware Forge\n <forge-bot+redi@forge-stage.sourceware.org>","To":"gcc-patches mailing list <gcc-patches@gcc.gnu.org>","Date":"Sat, 09 Nov 2024 11:57:07 +0000","Message-ID":"\n <bmm.h1n4wldn0g.gcc.gcc-TEST.redi.9.67.REVIEW@forge-stage.sourceware.org>","In-Reply-To":"\n <bmm.hhuay3vzv6.gcc.gcc-TEST.ppalka.9.1.0@forge-stage.sourceware.org>","X-Mailer":"batrachomyomachia","X-Requested-Reviewer":"redi","X-Pull-Request-Organization":"gcc","X-Pull-Request-Repository":"gcc-TEST","X-Pull-Request":"https://forge.sourceware.org/gcc/gcc-TEST/pulls/9","X-Review":"https://forge.sourceware.org/gcc/gcc-TEST/pulls/9#issuecomment-346","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"7bit","MIME-Version":"1.0","X-BeenThere":"gcc-patches@gcc.gnu.org","X-Mailman-Version":"2.1.30","Precedence":"list","List-Id":"Gcc-patches mailing list <gcc-patches.gcc.gnu.org>","List-Unsubscribe":"<https://gcc.gnu.org/mailman/options/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe>","List-Archive":"<https://gcc.gnu.org/pipermail/gcc-patches/>","List-Post":"<mailto:gcc-patches@gcc.gnu.org>","List-Help":"<mailto:gcc-patches-request@gcc.gnu.org?subject=help>","List-Subscribe":"<https://gcc.gnu.org/mailman/listinfo/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe>","Errors-To":"gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org"}},{"id":3680430,"web_url":"http://patchwork.ozlabs.org/comment/3680430/","msgid":"<bmm.h1n4gj9qm8.gcc.gcc-TEST.redi.9.61.REVIEW@forge-stage.sourceware.org>","list_archive_url":null,"date":"2024-11-09T11:40:56","subject":"Re: [PATCH v1 0/3] libstdc++: Implement C++23 <flat_map> and\n <flat_set>","submitter":{"id":93210,"url":"http://patchwork.ozlabs.org/api/people/93210/","name":"Jonathan Wakely via Sourceware Forge","email":"forge-bot+redi@forge-stage.sourceware.org"},"content":"Jonathan Wakely (redi) <redi@gcc.gnu.org>) commented on the code:\n\n\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +818,4 @@\n> +\t    }\n> +\t  __catch(...)\n> +\t    {\n> +\t      __c.clear();\nRAII guard instead?\n\n> +++ libstdc++-v3/include/std/flat_map\n> @@ -0,0 +818,4 @@\n> +\t    }\n> +\t  __catch(...)\n> +\t    {\n> +\t      __c.clear();\nFixed\n\n\n--\nhttps://forge.sourceware.org/gcc/gcc-TEST/pulls/9#issuecomment-335","headers":{"Return-Path":"<gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org>","X-Original-To":["incoming@patchwork.ozlabs.org","gcc-patches@gcc.gnu.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","gcc-patches@gcc.gnu.org"],"Authentication-Results":["legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=38.145.34.32; helo=vm01.sourceware.org;\n envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org;\n receiver=patchwork.ozlabs.org)","sourceware.org; dmarc=none (p=none dis=none)\n header.from=forge-stage.sourceware.org","sourceware.org;\n spf=pass smtp.mailfrom=forge-stage.sourceware.org","server2.sourceware.org;\n arc=none smtp.remote-ip=38.145.34.39"],"Received":["from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g0wMg0R0sz1yD5\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 20:25:03 +1000 (AEST)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id E49E14BB58CE\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 10:25:00 +0000 (GMT)","from forge-stage.sourceware.org (vm08.sourceware.org [38.145.34.39])\n by sourceware.org (Postfix) with ESMTPS id CB84A4BA902E\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 10:16:10 +0000 (GMT)","from forge-stage.sourceware.org (localhost [IPv6:::1])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256)\n (No client certificate requested)\n by forge-stage.sourceware.org (Postfix) with ESMTPS id 991C540568\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 10:16:03 +0000 (UTC)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org E49E14BB58CE","OpenDKIM Filter v2.11.0 sourceware.org CB84A4BA902E"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org CB84A4BA902E","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org CB84A4BA902E","ARC-Seal":"i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776852970; cv=none;\n b=ZexEKbz57HF76R/repc4KHRsLw17Fyw7QQV4KRr95ESxjIEZ0NmxDp3j4jntPHCEJFBKhFiBI4Lpy86Vp+rr3l8IKlF823kBMdoEikirCSazzG/zaG7hfFTF2MZjLvf4l4Z6aYUCDJnlNfu+VU8LX5Iyp3scT/Qxs/qaFnKhHZE=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1776852970; c=relaxed/simple;\n bh=FdYufrmrN6B44zUEHR0RzwIWiQYKmtCBK9gwsRBZwtY=;\n h=Subject:From:To:Date:Message-ID:MIME-Version;\n b=RE/rzTK1fIUsSfqziid4NbQRIW5DR6PIABWNbXx6UtQNb+Mk/16QCJfGmnh9VpNdfRHa7NkywU+GMhnHZ4KSMRIEsGRHd53oifGcy0N6QY5cZBAk1tD7RIEZcc97+v3DlpQHQpQz+skWh9e01dtFsCU6olH5NgpPS63afPt1Nm8=","ARC-Authentication-Results":"i=1; server2.sourceware.org","Subject":"Re: [PATCH v1 0/3] libstdc++: Implement C++23 <flat_map> and\n <flat_set>","From":"Jonathan Wakely via Sourceware Forge\n <forge-bot+redi@forge-stage.sourceware.org>","To":"gcc-patches mailing list <gcc-patches@gcc.gnu.org>","Date":"Sat, 09 Nov 2024 11:40:56 +0000","Message-ID":"\n <bmm.h1n4gj9qm8.gcc.gcc-TEST.redi.9.61.REVIEW@forge-stage.sourceware.org>","In-Reply-To":"\n <bmm.hhuay3vzv6.gcc.gcc-TEST.ppalka.9.1.0@forge-stage.sourceware.org>","X-Mailer":"batrachomyomachia","X-Requested-Reviewer":"redi","X-Pull-Request-Organization":"gcc","X-Pull-Request-Repository":"gcc-TEST","X-Pull-Request":"https://forge.sourceware.org/gcc/gcc-TEST/pulls/9","X-Review":"https://forge.sourceware.org/gcc/gcc-TEST/pulls/9#issuecomment-335","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"7bit","MIME-Version":"1.0","X-BeenThere":"gcc-patches@gcc.gnu.org","X-Mailman-Version":"2.1.30","Precedence":"list","List-Id":"Gcc-patches mailing list <gcc-patches.gcc.gnu.org>","List-Unsubscribe":"<https://gcc.gnu.org/mailman/options/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe>","List-Archive":"<https://gcc.gnu.org/pipermail/gcc-patches/>","List-Post":"<mailto:gcc-patches@gcc.gnu.org>","List-Help":"<mailto:gcc-patches-request@gcc.gnu.org?subject=help>","List-Subscribe":"<https://gcc.gnu.org/mailman/listinfo/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe>","Errors-To":"gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org"}}]