Allow to use rvalue reference (n2027)?

Liu, Xin xxinliu at amazon.com
Wed Feb 12 16:58:04 UTC 2020


Hi,

I found that you guys plan to turn on C++14 in JDK-8208089.  Selected features are permitted, eg. constexpr.

I didn’t find rvalue reference in the permit list.  May I know if hotspot allows it if we eventually turn on -std=c++11 or c++14?
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2027.html

Move semantics can eliminate copys of temporary objects.  An alternative approach is to use dynamic allocation and smart pointer. That approach still copys a lot but are significantly cheaper. IMHO, smart pointers like unique_ptr or shared_ptr are not welcomed, right?
It’s because they’re in C++ standard library, which hotspot tries to avoid.

On the other side, I think rvalue reference(n2027) is very portable and reliable now.

Thanks,
--lx





More information about the hotspot-runtime-dev mailing list