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] Remove some variables in favor of using gdb::optional


>>>>> "Simon" == Simon Marchi <simon.marchi@polymtl.ca> writes:

Simon> While reading that code, I noticed that some variables essentially meant
Simon> whether to consider some other variable or not.  I think using
Simon> gdb::optional (which was not available when this code was written) is
Simon> clearer, as it embeds the used/not used predicate directly in the type
Simon> of the variable, making it harder to miss.

Thanks, this looks reasonable to me.

Simon> +  /* If set, only look for symbols that match that block.  Valid values are
Simon> +     GLOBAL_BLOCK and STATIC_BLOCK.  */
Simon> +  gdb::optional<int> block_index;

I guess optional<block_enum> would be even better here.

Tom


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