-
Enhancement
-
Resolution: Fixed
-
P4
-
14
-
b26
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8263961 | 13.0.7 | Olga Mikhaltcova | P4 | Resolved | Fixed | b04 |
JDK-8243588 | 11.0.8-oracle | David Buck | P4 | Resolved | Fixed | b04 |
JDK-8245075 | 11.0.8 | Kim Barrett | P4 | Resolved | Fixed | b04 |
A common case is a class that should never be copied, for semantic reasons. It would be helpful to have a simple idiom to support that case. This would make it obvious the Rule of 3 is followed for the class, and help make cases where it isn't stand out a bit more so they get additional scrutiny.
The suggested solution for the noncopyable case is to provide the following macro:
// Declare the named class to be noncopyable. This macro must be used in
// a private part of the class's definition. Doing so provides private
// declarations for the class's copy constructor and assignment operator.
// Because these operations are private, most potential callers will fail
// to compile because they are inaccessible. The operations intentionally
// lack a definition, to provoke link-time failures for calls from contexts
// where they are accessible, e.g. from within the class or from a friend
// of the class.
// Note: The lack of definitions is still not completely bullet-proof,
// as an apparent call might be optimized away by copy elision.
// For C++11 the declarations should be changed to deleted definitions.
#define NONCOPYABLE(C) C(C const&); C& operator=(C const&);
- backported by
-
JDK-8243588 Provide idiom for declaring classes noncopyable
-
- Resolved
-
-
JDK-8245075 Provide idiom for declaring classes noncopyable
-
- Resolved
-
-
JDK-8263961 Provide idiom for declaring classes noncopyable
-
- Resolved
-
- duplicates
-
JDK-8244162 Additional opportunities to use NONCOPYABLE
-
- Resolved
-
- relates to
-
JDK-8247869 Change NONCOPYABLE to delete the operations
-
- Resolved
-
-
JDK-8263996 Fix build on 13u after JDK-8234779 backport
-
- Resolved
-
-
JDK-8230611 infinite loop in LogOutputList::wait_until_no_readers()
-
- Resolved
-
-
JDK-8234691 Potential double-free in ParallelSPCleanupTask constructor
-
- Resolved
-
-
JDK-8234773 Fix ThreadsSMRSupport::_bootstrap_list
-
- Resolved
-