RFR: 8319117: GrowableArray: Allow for custom initializer instead of copy constructor [v2]

Johan Sjölen jsjolen at openjdk.org
Wed Nov 1 15:26:04 UTC 2023


On Wed, 1 Nov 2023 14:45:34 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:

>> Fixed, thanks for the help with this.
>
> For perfect forwarding, (non-const) `Args&&...` should be used together with `std::forward` when doing the downstream call to the constructor. That will make it so rvalue arguments are forwarded as rvalues as well. The current code turns all args into lvalues. (see the example code here e.g. https://en.cppreference.com/w/cpp/utility/forward)
> 
> Do we need to support NONCOPYABLE argument types as well?

Hi Jorn, the style guide currently doesn't allow for using perfect forwarding or move semantics in the code, so we cannot do this at the moment.

There's a PR for that: https://github.com/openjdk/jdk/pull/15386

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/16409#discussion_r1378941108


More information about the hotspot-dev mailing list