RFR: 8314502: Change the comparator taking version of GrowableArray::find to be a template method [v7]
Quan Anh Mai
qamai at openjdk.org
Sat Oct 28 15:29:32 UTC 2023
On Thu, 26 Oct 2023 02:24:49 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> You can bind a non-const reference to a const one but not the other way.
>
> Sorry I was unclear: what is the advantage of a reference here? Is it just to avoid copying
@dholmes-ora Yes it helps avoid copying, especially if the copy constructor is non-trivial. And I think it is more idiomatic in C++ to use references here.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/15418#discussion_r1375271244
More information about the hotspot-dev
mailing list