On Thu, 7 Sep 2023 07:03:44 GMT, Afshin Zafari <azaf...@openjdk.org> wrote:
>> There can be a confusion related to selection of type names T and E: >> T is intuitively treated as a table and E as an element. >> No pressure but I wonder if using D instead of T would be better. > >> 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. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15418#discussion_r1318173657