ui_out format strings for fields and styles (Re: [PATCH] Style "pwd" output)

Tom Tromey tom@tromey.com
Mon Jul 1 17:26:00 GMT 2019


>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:

Pedro>  static inline styled_string_s *
Pedro>  styled_string (const ui_file_style &style, const char *str,
Pedro>                styled_string_s &&tmp = {})

Nice trick -- I hadn't seen that one before!

Pedro> Here's a patch implementing the idea above.  I wrote this a couple
Pedro> weeks ago, and at the time I felt more strongly about it.  Is this
Pedro> worth it?

Yes, I think so.  It removes some clutter.  The expense is that the call
is tricky and can't be relied on outside of an argument list, really;
but on the other hand I don't expect these things to be used elsewhere.

Tom



More information about the Gdb-patches mailing list