public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH 2/2] libstdc++: Use template form for pretty-printing tuple elements
@ 2021-06-13 16:38 Paul Smith
  0 siblings, 0 replies; only message in thread
From: Paul Smith @ 2021-06-13 16:38 UTC (permalink / raw)
  To: gcc

std::tuple elements are retrieved via std::get<> (template) not
[] (array); have the generated output string match this.

libstdc++-v3/ChangeLog:

        * python/libstdcxx/v6/printers.py (StdTuplePrinter): Use <> not [].
---
The previous patch seems uncontroversial to me.  I don't know about this one:
I'm not sure if there's any precedent for this type of output although to me
it looks better since tuples cannot be retrieved via array indexing.

 libstdc++-v3/python/libstdcxx/v6/printers.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libstdc++-v3/python/libstdcxx/v6/printers.py b/libstdc++-v3/python/libstdcxx/v6/printers.py
index 14a6d998690..0063a3185a6 100644
--- a/libstdc++-v3/python/libstdcxx/v6/printers.py
+++ b/libstdc++-v3/python/libstdcxx/v6/printers.py
@@ -567,7 +567,7 @@ class StdTuplePrinter:
             if len (fields) > 0 and fields[0].name == "_M_head_impl":
                 impl = impl['_M_head_impl']

-            out = '[%d]' % self.count
+            out = '<%d>' % self.count
             self.count = self.count + 1

             return (out, impl)
--
2.28.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-06-13 16:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-13 16:38 [PATCH 2/2] libstdc++: Use template form for pretty-printing tuple elements Paul Smith

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