This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[users/palves/format_strings] Down with .ptr() (Re: ui_out format strings for fields and styles (Re: [PATCH] Style "pwd" output))


On 7/1/19 6:26 PM, Tom Tromey wrote:
>>>>>> "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.

Yeah, if we ever need to instantiate one of these outside an argument
list, we can still instantiate a styled_string_s instead of
calling styled_string.  But I also don't expect this to be ever necessary.

Alright, I merged this one to users/palves/format_strings.

Thanks,
Pedro Alves


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]