From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id asdeGi4+4WmZ1RwAWB0awg (envelope-from ) for ; Thu, 16 Apr 2026 15:53:18 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=polymtl.ca header.i=@polymtl.ca header.a=rsa-sha256 header.s=oct2025 header.b=lvXS9mu8; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 56EDB1E04F; Thu, 16 Apr 2026 15:53:18 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.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,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.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 47DEA1E04F for ; Thu, 16 Apr 2026 15:53:17 -0400 (EDT) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id AE9814C900C7 for ; Thu, 16 Apr 2026 19:53:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AE9814C900C7 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=polymtl.ca header.i=@polymtl.ca header.a=rsa-sha256 header.s=oct2025 header.b=lvXS9mu8 Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 110464B9DB70 for ; Thu, 16 Apr 2026 19:52:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 110464B9DB70 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=polymtl.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=polymtl.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 110464B9DB70 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=132.207.4.11 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776369174; cv=none; b=ThCp3oZowPHPdgmpV22Q0WF69jj+cFXzfLfQ6xD7wDl+mnrtY4kXo4Siwaz3G12l6dQnt3wYw9WWsHkjokYOe/7HVHEEgLsu53WyTec71pRVhqyeqHB3MrtjaX55IuUE/oKjJwUASTFexpFHDRLrspT2IwrStneXgGrLJO/cVOg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776369174; c=relaxed/simple; bh=IYhdUnllvfuceOEHQEl52pGL25CB89BoBxm3Q3zl2GE=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=bD+HsYi+NI6WJDxfQq5SX7FCqMaYg9xgw0BvrWUH9gHdH3ZvZVJO8ti2e6GiBAQX/b+fDaXwTkSHVU60W9Zlu6z0+UzoLnL6z4wCZGOZuXE3Ku6t2kWwhssh9vhokQU4fRQbhYG6OVt7aCOc8Mxw0bvUpNS9+EcK0P4fgcPmKvo= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 110464B9DB70 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 63GJqmTV081488 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 16 Apr 2026 15:52:53 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 63GJqmTV081488 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=oct2025; t=1776369173; bh=QBv7/tU4pJHVoQ1CjA/INP2EMHt2ZVtIhF4wCyS51Rs=; h=Date:Subject:To:From:In-Reply-To:From; b=lvXS9mu8SGQjfDQmPh36L753xtLax07F/1aw39gJ2B4rqUSB2bCsiK0esphU5ZxXg 709MenZtqNpkdaWRfYXKpl5EhUG/kwaSEoVeZPzeVsboNJsnPVDumH/SdBHj2vfK3i +1ArOsTX3olMARDA8sUbHT6EO7npcHNsrIJZ9AkXCpW8TbTCf6uHE39hpqS/+kFMY1 J1fpzRoEP1W5huA6wiTmVyJAoqN8FIXnAWU664f8yPPHKa02nZVRhxuxPxITwelSd7 Amhws27bRRDCkwERmNg80fUy8r0DKAW5yefqf5kKOK2tIvbT5FtUaWzZfrzxZZpdg2 ChzzI7vfFyBAA== Received: by simark.ca (Postfix) id 8AE121E04F for ; Thu, 16 Apr 2026 15:52:48 -0400 (EDT) Message-ID: <74e7aca0-3a25-4151-87ba-b03fad16b7d9@polymtl.ca> Date: Thu, 16 Apr 2026 15:52:48 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 1/3] gdbsupport: add gdb::ranges::views::enumerate util To: gdb-patches@sourceware.org References: <20260220202002.860008-1-simon.marchi@efficios.com> <20260221011924.2029855-1-simon.marchi@polymtl.ca> Content-Language: fr From: Simon Marchi In-Reply-To: <20260221011924.2029855-1-simon.marchi@polymtl.ca> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Thu, 16 Apr 2026 19:52:48 +0000 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 2/20/26 8:18 PM, simon.marchi@polymtl.ca wrote: > From: Simon Marchi > > Add a "enumerate" utility, that acts pretty much like Python's > enumerate(). It makes the code slightly nicer, for when you would > otherwise need to handle the counter by hand. > > It can be used like this: > > std::vector my_vector; > for (auto [i, val] : gdb::ranges::views::enumerate (my_vector)) > ... > > `i` will hold the 0-based index of the current iteration, and `val` will > be a reference to the value of the current iteration. > > The name is chosen to match std::ranges::views::enumerate from C++23, > making it easy to switch to that eventually. > > Change-Id: I1870ab50537bcf54bba44a30a0b01ab397be16e3 I pushed all 3 patches of this series. Simon