public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Why does the prettyprint of std::tuple start with [1]?
@ 2021-06-13 13:49 Paul Smith
  2021-06-13 15:35 ` Paul Smith
  0 siblings, 1 reply; 3+ messages in thread
From: Paul Smith @ 2021-06-13 13:49 UTC (permalink / raw)
  To: gdb

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]?


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-06-13 15:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-13 13:49 Why does the prettyprint of std::tuple start with [1]? Paul Smith
2021-06-13 15:35 ` Paul Smith
2021-06-13 15:43   ` David Blaikie

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).