Struct UnsafeInit#
Defined in File object.h
Struct Documentation#
-
struct UnsafeInit#
Helper tag to explicitly request unsafe initialization.
Constructing an ObjectRefType with UnsafeInit{} will set the data_ member to nullptr.
When initializing Object fields, ObjectRef fields can be set to UnsafeInit. This enables the “construct with UnsafeInit then set all fields” pattern when the object does not have a default constructor.
Used for initialization in controlled scenarios where such unsafe initialization is known to be safe.
Each ObjectRefType should have a constructor that takes an UnsafeInit tag.
Note
As the name suggests, do not use it in normal code paths.