From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id EccVCbov+WqWmg4AWB0awg (envelope-from ) for ; Sat, 14 Nov 2026 23:06:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1794715578; bh=Wy0qJHSkMAavZ7CnRZppi/kLxRDnpdnKy4uebrulUH0=; h=Date:Subject:To:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=KRWlfNBHrVs+Cp1r5el6TPCNbI0bVln/Nal9Qpz2ZrIKeQfTkLOT+vPQqbJMtfnuT mf+9WJQqgLyESTBRdf0WiWAoM7RXYZ0iIDcGIvoxhseC27mwq4eEo6BLhbcOYFZ2S1 mhKTBe2MAA6/kBmlnhb8e4M16b6/gQ3x+PsDQ7ho= Received: by simark.ca (Postfix, from userid 112) id 153321E043; Sat, 14 Nov 2026 23:06:18 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=hjZWjPxc; dkim-atps=neutral Received: from vm01.sourceware.org (vm01.sourceware.org [IPv6:2620:52:6:3111::32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 8F9231E043 for ; Sat, 14 Nov 2026 23:06:17 -0500 (EST) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9E3634BA799A for ; Sun, 15 Nov 2026 04:06:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9E3634BA799A Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=hjZWjPxc Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id B62F64BA7999 for ; Sun, 15 Nov 2026 04:05:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B62F64BA7999 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org B62F64BA7999 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=158.69.221.121 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1794715551; cv=none; b=Fcm89Y9wFG0TkNHOdi+PGFpowc4SjV6puikvLAXGgpLf876kjot5WwxicywhsR71HxCnB92P7dYCEIjM2FwNIDzJvakNQ4MIHD8avuA/W+oQTs/Z82fWH4qIN5ee20d4bNFyO40LuarReh0P2pWhgjui/gYzMkn2cQf51WR1ZpY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1794715551; c=relaxed/simple; bh=Wy0qJHSkMAavZ7CnRZppi/kLxRDnpdnKy4uebrulUH0=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=MriR18i/8pgCkaaqbP/1GNS7/99x81dGEXBMtMoBWBfUmxkY+VWCgC/TpyH7Ntv1CkPpI/1ihBbUndr2brK/I/v0i5mlB8s+fzwcWUBEVEL17Pt3CTven3VJVGAIfcCbPQhjPf088ZnXJ58XFFvO/AYA0le6OmcAjV0DiQoFxp4= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=hjZWjPxc DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B62F64BA7999 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1794715550; bh=Wy0qJHSkMAavZ7CnRZppi/kLxRDnpdnKy4uebrulUH0=; h=Date:Subject:To:References:From:In-Reply-To:From; b=hjZWjPxcf/wBsw4e02GMTJic7Im0zRmj5102vO/bNR5TjNxBrIfBGY+fnPFPsu5CZ QauG4CW8GIhUcsL+HeSMXXVNc8HhS8ngARxMO61plnNHJ/dj7LTvD4dBc+vBsYiRGj vDAb7bOhJqpvPxf0dI8t6Ti1qPwC40p7exTJ7LBo= Received: by simark.ca (Postfix) id DD4CF1E043; Sat, 14 Nov 2026 23:05:49 -0500 (EST) Message-ID: <1ecb5ff1-c36e-4e83-8223-ab29a2ef833c@simark.ca> Date: Sat, 14 Nov 2026 23:05:49 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 14/15] Allow the use of C++20 std::span in gdbsupport/span.h To: Tom Tromey , gdb-patches@sourceware.org References: <20261111-span-part-1-v2-0-cd4e33a8a723@adacore.com> <20261111-span-part-1-v2-14-cd4e33a8a723@adacore.com> Content-Language: en-US From: Simon Marchi In-Reply-To: <20261111-span-part-1-v2-14-cd4e33a8a723@adacore.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org On 2026-11-11 10:59, Tom Tromey wrote: > This patch changes gdbsupport/span.h to check __cplusplus and then to > use std::span in this setup. > > Eventually, when gdb moves to C++20 (PR gdb/32660), this header can be > greatly simplified and we can rewrite "gdb::span" to "std::span". > Note that the header won't be really removable, because there are some > utility functions here that will need to remain. > > Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31422 > --- > gdbsupport/span.h | 61 ++++++++++++++++++++++++++++++++++++++++++------------- > 1 file changed, 47 insertions(+), 14 deletions(-) > > diff --git a/gdbsupport/span.h b/gdbsupport/span.h > index e3e3ddcbbd7..3759b05fb34 100644 > --- a/gdbsupport/span.h > +++ b/gdbsupport/span.h > @@ -60,6 +60,32 @@ > You can find unit tests covering the whole API in > unittests/span-selftests.c. */ > > +#if __cplusplus >= 202002L > + > +#include > + > +namespace gdb { > + > +/* gdb::span. */ > +template using span = std::span; > + > +/* gdb::ranges::equal. */ > +namespace ranges > +{ > + > +template > +constexpr bool > +equal (R1 &&r1, R2 &&r2) I think the "gdb::ranges::equal" comment should be inside the namespace. Simon