On Fri, 25 Aug 2023 11:02:24 GMT, Stefan Karlsson <stef...@openjdk.org> wrote:
>> 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. > > Updated in-place Not a review, just agreeing with @stefank and @jdksjolen . What they describe is idiomatic C++. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15418#discussion_r1306553072