mirror of
https://github.com/openjdk/jdk.git
synced 2026-01-28 12:09:14 +00:00
8373207: Make DeferredStatic class template constant initializable
Reviewed-by: jsjolen, stefank, iwalulya
This commit is contained in:
parent
1ae4a6c43e
commit
7f9951a934
@ -35,7 +35,7 @@
|
||||
// object must be explicitly initialized before use. This avoids problems
|
||||
// resulting from the unspecified initialization time and ordering between
|
||||
// different objects that comes from using undeferred objects (the so-called
|
||||
// "Static Initialization Order Fiasco).
|
||||
// "Static Initialization Order Fiasco").
|
||||
//
|
||||
// Once initialized, the object is never destroyed. This avoids similar issues
|
||||
// with the timing and ordering of destruction on normal program exit.
|
||||
@ -53,7 +53,7 @@ class DeferredStatic {
|
||||
public:
|
||||
NONCOPYABLE(DeferredStatic);
|
||||
|
||||
DeferredStatic()
|
||||
constexpr DeferredStatic()
|
||||
DEBUG_ONLY(: _initialized(false)) {
|
||||
// Do not construct value, on purpose.
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user