On Thu, 7 Sep 2023 07:06:46 GMT, Afshin Zafari <azaf...@openjdk.org> wrote:

>>> Also, why isn't this change also being applied to `find_from_end`
>> 
>> Thank you @kimbarrett, the function is also changed accordingly.
>
>> We could just as well do a capturing lambda here, yes. Then we'd have:
>> 
>> ```c++
>> template<F>
>> int find(F finder);
>> ```
>> 
>> It'd be a template instead of function pointer since it's a capturing lambda 
>> and `std::function` is not permitted in Hotspot AFAIK.
>> 
>> As an aside, to clarify for readers: There's a `&` missing in the capture 
>> list of your examples.
> 
> It would be nice to have this templated Function as finder. However, I think 
> it is better to keep the changes small and manageable for this PR. Thanks for 
> the comment.

> Also, why isn't this change also being applied to `find_from_end`

Thanks Kim! It is also changed.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/15418#discussion_r1326901038

Reply via email to