Re: [PATCH 1/3] gdb/objfiles: make objfile::sections yield references

Tom Tromey
2025-08-29T13:35:28Z

>>>>> "Simon" == Simon Marchi <simon.marchi@efficios.com> writes:

Simon> A patch later in this series would change objfile::section_iterator to
Simon> yield `obj_section &` instead of `obj_section *`. Do it as a
Simon> preparatory patch to avoid polluting that subsequent patch. I think it
Simon> would make sense on its own anyway.

Seems ok.

Simon> - typedef section_iterator self_type;
Simon> - typedef obj_section *value_type;
Simon> + using self_type = section_iterator;
Simon> + using reference = obj_section &;

I never remember when value_type or reference need to be declared.
Is it really correct to remove value_type?

Approved-By: Tom Tromey <tom@tromey.com>

Tom