Re: [PATCH 2/3] gdbsupport: make filtered_iterator work with pointers

Simon Marchi
2025-08-29T20:12:31Z

On 2025-08-29 13:39, Tom Tromey wrote:
>>>>>> "Simon" == Simon Marchi <simon.marchi@efficios.com> writes:
>
>>> I also wonder what this constructor is even needed for since it seems
>>> like a filtered iterator should just wrap an ordinary one anyway.
>
> Simon> I think it's just a shortcut to have less boilerplate when you need to
> Simon> instantiate a filtered_iterator. I think I would prefer having just the
> Simon> begin/end version, so that there is less magic involved, making it
> Simon> easier to debug compilation errors, at the expense of having to be more
> Simon> explicit at the call sites. I think I tried it in a previous iteration
> Simon> of this series and gave up, but if you think it's a good idea, I can try
> Simon> it again.
>
> I think you should go ahead, we can try to remove the template
> constructor after.
>
> Approved-By: Tom Tromey <tom@tromey.com>
>
> Tom

All right, I'll push this patch and do some further cleanups.

Thanks,

Simon