Re: Why does the prettyprint of std::tuple start with [1]?

David Blaikie via Gdb <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <CAENS6Es6NX-2WJbNBSEj8UG1OYEsvG9ueRxQw7KxUnA6qtZkQA@mail.gmail.com>
Likely it does, yeah.

Probably a bug in libstdc++'s pretty printer:

https://github.com/gcc-mirror/gcc/blob/8a7d54b1e10b8f4fba1358260ed2e7056ed23cbd/libstdc%2B%2B-v3/python/libstdcxx/v6/printers.py#L528

https://github.com/gcc-mirror/gcc/blob/8a7d54b1e10b8f4fba1358260ed2e7056ed23cbd/libstdc%2B%2B-v3/python/libstdcxx/v6/printers.py#L563

Something related to those bits of code.

On Sun, Jun 13, 2021 at 8:37 AM Paul Smith <[email protected]> wrote:

> 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<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]?
>
> Hm, maybe this belongs on the GCC mailing list instead of here.
>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.