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]

Re: [PATCH 16/22] Class-ify ui_out_level


On 2016-11-30 07:06, Pedro Alves wrote:
On 11/26/2016 04:22 PM, Simon Marchi wrote:
I had a discussion about this with Antoine.  Is it a good practice to
use explicit all the time, and only omit it when there's a good reason
why?

Yes, I believe so.

Let's turn the question around: why _would_ you want to support
implicit conversion from ui_out_type to ui_out_level?
E.g, would this code make any sense?

  ui_out_level level = ui_out_type_list;
  if (level == ui_out_type_tuple)

I'd leave implicit conversions for when you're actually trying
to code a converting constructor.

Ok that was my first thought as well, only omit explicit when it's a conscious decision to do so. I'll go back and re-add it to my patches :).


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