RFR: 8314502: Change the comparator taking version of GrowableArray::find to be a template method [v2]
Kim Barrett
kbarrett at openjdk.org
Sat Aug 26 18:51:09 UTC 2023
On Fri, 25 Aug 2023 11:02:24 GMT, Stefan Karlsson <stefank at 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
More information about the hotspot-dev
mailing list