RFR: 8319117: GrowableArray: Allow for custom initializer instead of copy constructor [v2]
Jorn Vernee
jvernee at openjdk.org
Wed Nov 1 14:50:05 UTC 2023
On Tue, 31 Oct 2023 12:56:33 GMT, Johan Sjölen <jsjolen at openjdk.org> wrote:
>> I see, in that case it must be `const Args&... args`. https://godbolt.org/z/aov8v38s9
>
> 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?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/16409#discussion_r1378898208
More information about the hotspot-dev
mailing list