diff --git a/doc/hotspot-style.html b/doc/hotspot-style.html index ced607d71090e..d7d9335f6f310 100644 --- a/doc/hotspot-style.html +++ b/doc/hotspot-style.html @@ -1093,6 +1093,8 @@

Attributes

Additional Permitted Features

diff --git a/doc/hotspot-style.md b/doc/hotspot-style.md index 9743c77871fae..83ac2b7bfc6a8 100644 --- a/doc/hotspot-style.md +++ b/doc/hotspot-style.md @@ -1086,6 +1086,17 @@ The following attributes are expressly forbidden: ### Additional Permitted Features +* Rvalue references and move semantics +([n1690](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1690.html)) +* Use `std::move` when moving an object. +Rvalue references and move semantics is an advanced C++ concept and should be +treated as such. In HotSpot we prefer copy construction when possible. +However, we do recognize that there are cases where move semantics permit significant +ergonomic and performance advantages to the developer. +For example, if you have a data structure T which is non-copyable but needs to +be stored in a resizable container, then defining a move constructor may be preferable +to changing the contained element type from T to T\*. + * `alignof` ([n2341](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2341.pdf)) @@ -1210,8 +1221,6 @@ features that have not yet been discussed. * Member initializers and aggregates ([n3653](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3653.html)) -* Rvalue references and move semantics - [ADL]: https://en.cppreference.com/w/cpp/language/adl "Argument Dependent Lookup"