On Thu, 26 Oct 2023 02:24:49 GMT, David Holmes <dhol...@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