RFR: 8234779: Provide idiom for declaring classes noncopyable

John Rose john.r.rose at oracle.com
Fri Nov 29 23:04:59 UTC 2019


On Nov 27, 2019, at 1:49 PM, Kim Barrett <kim.barrett at oracle.com> wrote:
> 
> The proposed macro significantly reduces that wordiness.  Far more
> importantly, it makes the intent entirely self-evident; there's no
> need for any explanatory comments.

Or to put it another way, the explanatory comments can be centralized
in the header file which defines the macro.  And the macro can be given
a name which explains the intent.  The name and comments can reflect
HotSpot-specific “house rules” (local design rules and conventions).

On Nov 29, 2019, at 1:45 PM, Kim Barrett <kim.barrett at oracle.com> wrote:
> … I also like putting repetitive code behind names to make it
> easier to chunk and understand.


+1  A well-chosen macro name can be easier to read than a chunk of boilerplate.
This is especially applicable to us since C++ boilerplate evolves over time, and
as a highly portable system we don’t have the ability to track one particular
dialect of C++.  But even if we did, we'd still have complex “house rules” to
enforce and document, and macros play a role there.

I don’t think that learning the “house macros” for HotSpot is an excessive
burden for people learning to work on HotSpot.  Kim’s proposal seems to
be yet another one of these macros.

Thanks, Kim and Per, for marshaling the arguments pro and con.

— John


More information about the hotspot-dev mailing list