From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gateway22.websitewelcome.com (gateway22.websitewelcome.com [192.185.46.234]) by sourceware.org (Postfix) with ESMTPS id B3177384F031 for ; Sun, 13 Jun 2021 15:35:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B3177384F031 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=mad-scientist.net Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=mad-scientist.net Received: from cm13.websitewelcome.com (cm13.websitewelcome.com [100.42.49.6]) by gateway22.websitewelcome.com (Postfix) with ESMTP id 16BAF11480 for ; Sun, 13 Jun 2021 10:35:13 -0500 (CDT) Received: from box5922.bluehost.com ([162.241.30.80]) by cmsmtp with SMTP id sS8nlWEpVhbxpsS8nlGinM; Sun, 13 Jun 2021 10:35:13 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mad-scientist.us; s=default; h=Content-Transfer-Encoding:MIME-Version: Content-Type:References:In-Reply-To:Date:To:Reply-To:From:Subject:Message-ID: Sender:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=yFNZu63tmvEDTLFS+uNZ9GLqdWUWVQuE7x2vkGkdyII=; b=2BwHnpkqPaXmG8khw1N8Jvs86b av7ahjT1lGManYiSq51KaY0nf8ELtXQHL3wx+WYtgearCXX1mYh3cj44f5BvfKVT9ySzV7vQolS+X rQ3zk3CbN8YNLThM3BCC7XgA4; Received: from pool-96-233-64-159.bstnma.fios.verizon.net ([96.233.64.159]:33068 helo=pdslaptop.home.arpa) by box5922.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1lsS8m-001l06-QZ for gdb@sourceware.org; Sun, 13 Jun 2021 09:35:12 -0600 Message-ID: <77ad0c73ddd4c4485f2e214b68c8ce474e1c96f8.camel@mad-scientist.net> Subject: Re: Why does the prettyprint of std::tuple start with [1]? From: Paul Smith Reply-To: paul@mad-scientist.net To: gdb@sourceware.org Date: Sun, 13 Jun 2021 11:35:11 -0400 In-Reply-To: References: Organization: Please remain calm--I may be mad but I am a professional! Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5-0ubuntu1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5922.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - mad-scientist.net X-BWhitelist: no X-Source-IP: 96.233.64.159 X-Source-L: No X-Exim-ID: 1lsS8m-001l06-QZ X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: pool-96-233-64-159.bstnma.fios.verizon.net (pdslaptop.home.arpa) [96.233.64.159]:33068 X-Source-Auth: paul@mad-scientist.us X-Email-Count: 1 X-Source-Cap: bWFkc2NpZTE7bWFkc2NpZTE7Ym94NTkyMi5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, JMQ_SPF_NEUTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_NEUTRAL, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jun 2021 15:35:15 -0000 On Sun, 2021-06-13 at 09:49 -0400, Paul Smith wrote: > Am I the only one to be confused by the fact that the pretty-printer > for std::tuple values starts indexing at 1 instead of 0? > > (gdb) p info > $1 = (const std::tuple &) @0x7fffffffd550: { > param = std::tuple containing = { > [1] = TestType::OneTest, > [2] = DataType::SomeData > }, > index = 2 > } > > Why aren't the indexes on the left numbered [0] and [1], > corresponding > to the values used with std::get(), instead of [1] and [2]? Hm, maybe this belongs on the GCC mailing list instead of here.