public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Paul Smith <paul@mad-scientist.net>
To: gdb@sourceware.org
Subject: Why does the prettyprint of std::tuple start with [1]?
Date: Sun, 13 Jun 2021 09:49:40 -0400	[thread overview]
Message-ID: <b3dbb107243449b50b97f534329075276deb7826.camel@mad-scientist.net> (raw)

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<TestType, DataType> &) @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]?


             reply	other threads:[~2021-06-13 13:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-13 13:49 Paul Smith [this message]
2021-06-13 15:35 ` Paul Smith
2021-06-13 15:43   ` David Blaikie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b3dbb107243449b50b97f534329075276deb7826.camel@mad-scientist.net \
    --to=paul@mad-scientist.net \
    --cc=gdb@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).